64位控制台应用程序/线程池的内存不足 [英] 64bit Console app / ThreadPool out of memory

查看:791
本文介绍了64位控制台应用程序/线程池的内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET web应用程序,它的使用没有任何问题,在64位的Windows 7机器8GB存储5GB运行内存。

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.

不过,当我创建在同一台机器上的一个新的C#控制台应用程序和重用的Web应用程序使用相同的组件,控制台应用程序,通过观察System.Environment.WorkingSet和系统运行的内存约为1.6GB(。 Diagnostics.Process.GetCurrentProcess()。WorkingSet64)。还有大量的物理内存左侧。它repros在两台不同的机器。

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.

这两个Web应用程序和控制台应用程序使用ThreadPool.QueueUserWorkItem启动一个后台线程加载大量数据。在后台线程的例外情况。

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?

推荐答案

这是简单的。默认情况下我的Visual Studio 2010创建的x86目标。它改变到x64解决了这个问题。

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

这篇关于64位控制台应用程序/线程池的内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆