64bit Console app / ThreadPool out of memory

匆匆过客 提交于 2019-12-11 05:35:44

问题


I have an ASP.NET web app and it's using 5GB memory running on 64bit Windows 7 machine with 8GB memory without any problem.

However, when I create a new C# console application on the same machine and reuse the same components the web app uses, the console app runs out of memory at about 1.6GB (by looking at System.Environment.WorkingSet and System.Diagnostics.Process.GetCurrentProcess().WorkingSet64). There are still plenty of physical memory left. It repros on 2 different machines.

Both web app and console app use ThreadPool.QueueUserWorkItem to start a background thread to load the large amount of data. The exception happens at the background thread.

I wonder if there is any default memory limit setting on console app or ThreadPool. What debug variables I can look at to see this limit?


回答1:


This is simple. By default my Visual Studio 2010 creates x86 target. Changing it to x64 solves the problem.



来源:https://stackoverflow.com/questions/9475355/64bit-console-app-threadpool-out-of-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!