Threads with OutOfMemoryException
Code:
public static void Thread(object state)
{
byte[] bytes = new byte[64000000];
}
In the following code I'm getting an OutOfMemoryException because I'm launching these threads 1024 times and only some of them gives me an exception.
I can't reduce the size of the chunk, its a mandatory requisite that I have a chunk of 64MB.
What can I do to fix this?
Re: Threads with OutOfMemoryException
Quote:
Originally Posted by
whellman
What can I do to fix this?
Change your design.
Re: Threads with OutOfMemoryException
You can't allocate 64 GB in a single process. I think the per-process limit is 2 GB (or, possibly, 3 GB) per process (all threads are under a single process).