![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||