Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

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

Reply
 
Old 07-06-2009   #1 (permalink)
Max Vernon


 
 

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

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


My System SpecsSystem Spec
Old 08-05-2009   #2 (permalink)
Bjarte Skogøy


 
 

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

Hi,
Maybe Sleep(1) would solve some problems? Check out this article:
http://www.bluebytesoftware.com/blog...4b8f3d1a1.aspx

regards
Bjarte Skogøy


"Max Vernon" <Max Vernon@xxxxxx> skrev i nyhetsmeldingen:
68786438-3514-40DC-86EB-EAAE8CD77C58@xxxxxx ...
Quote:

> 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
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
import-csv giving System.OutOfMemoryException PowerShell
Help. Getting System.Web.HttpUnhandledException' was thrown. .NET General
System.OutOfMemoryException PowerShell
Help: System.Threading.Timer doesn't work! .NET General
start System.Threading.Thread PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46