System.OutOfMemoryException thrown by System.Threading.Thread.Slee

M

Max Vernon

I have built some software that uses a variable number of threads. If I use
about 400 or so threads, the code runs fine, however when I use above about
800 or so I get System.OutOfMemoryException in various places such as
System.Threading.Thread.Sleep(0)

I need to use a relatively large number of threads since each thread access
a Web Service with inherent processing delays at the server end. Each thread
basically starts and then waits for the io completion before returning
results to the main application.

According to Windows Task Manager, my app is using 200M of memory. VM size
is just shy of 1GB. Task Manager reports I have 2.6GB available RAM (I'm not
using a pagefile at all). Clearly, I'm not out of memory, so something else
must be the root cause of this issue. Any ideas?

I'm using:

Visual Studio Pro 2008 Visual Basic
App is configured to use .Net 3.5
Machine is Windows XP x64 Pro with 8GB RAM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top