Results 1 to 5 of 5

Thread: Why I got System.OutOfMemoryException when using

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Why I got System.OutOfMemoryException when using

    Dim output1 = System.IO.File.ReadAllLines(file).ToString


    The file size is only 1 GB. My Page file is 128 GB. Why out of memory? It's 64bit system.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Why I got System.OutOfMemoryException when using

    It's a matter of how much memory can be allocated to your application. Check the Process class for some properties related to process memory usage. I don't think that there's another method specific to the current process but I've never tried so I'm not sure.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Why I got System.OutOfMemoryException when using

    Memory for my application?

    I bought a bunch of computers at 64 bits so I can handle large files.

    Hmm... how to improve that?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Why I got System.OutOfMemoryException when using

    Having a 64-bit computer has nothing really to do with your app's ability to handle large files unless you're talking about really enormous files. Even then, your app has the same default memory allocations. Read my previous post and use the information provided or don't.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: Why I got System.OutOfMemoryException when using

    Have you actually specified that your application is compiled for 64 bit and not accidently set it to 32?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width