-
January 8th, 2013, 11:24 PM
#1
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?
-
January 8th, 2013, 11:59 PM
#2
Re: Threads with OutOfMemoryException
Originally Posted by whellman
What can I do to fix this?
Change your design.
-
January 10th, 2013, 12:20 AM
#3
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).
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|