I got the following problem
我有以下问题。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123
[ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11569328
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +485
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +337
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167
[HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11702064
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4870277
I didn't change the code ? what is this problem mean ,, as I see there is no more declaration about the error
我没有修改代码吗?这个问题是什么意思,我看到没有关于错误的声明了?
5 个解决方案
#1
26
This problem usually occurs when some process such as loading huge data to memory stream and your system memory is not capable of storing so much of data. Try clearing temp folder by giving the command
当某些进程(如将大量数据加载到内存流中以及系统内存无法存储如此多的数据)时,通常会出现这种问题。通过给出命令来尝试清除temp文件夹。
start -> run -> %temp%
启动->运行-> %temp%
#2
10
Running in Debug Mode
在调试模式下运行
When you're developing and debugging an application, you will typically run with the debug attribute in the web.config file set to true and your DLLs compiled in debug mode. However, before you deploy your application to test or to production, you should compile your components in release mode and set the debug attribute to false.
在开发和调试应用程序时,通常使用web中的debug属性来运行。配置文件设置为true, dll在调试模式下编译。但是,在将应用程序部署到测试或生产环境之前,应该以发布模式编译组件,并将debug属性设置为false。
ASP.NET works differently on many levels when running in debug mode. In fact, when you are running in debug mode, the GC will allow your objects to remain alive longer (until the end of the scope) so you will always see higher memory usage when running in debug mode.
ASP。在调试模式下运行时,NET在许多级别上的工作方式都不同。实际上,当您在调试模式下运行时,GC将允许您的对象保持更长的生命周期(直到作用域结束),因此在调试模式下运行时,您将始终看到更高的内存使用量。
Another often unrealized side-effect of running in debug mode is that client scripts served via the webresource.axd and scriptresource.axd handlers will not be cached. That means that each client request will have to download any scripts (such as ASP.NET AJAX scripts) instead of taking advantage of client-side caching. This can lead to a substantial performance hit.
在调试模式下运行的另一个经常未实现的副作用是通过webresource服务的客户端脚本。axd scriptresource。axd处理程序不会被缓存。这意味着每个客户端请求都必须下载任何脚本(如ASP)。NET AJAX脚本)而不是利用客户端缓存。这可能会对性能造成重大影响。
来源:http://blogs.iis.net/webtopics/archive/2009/05/22/troubleshooting-system-outofmemoryexceptions-in-asp-net.aspx
#3
#4
5
I just restarted Visual Studio and did IISRESET which solved the problem.
我重新启动了Visual Studio并进行了IISRESET,解决了这个问题。
#5
4
If you're using IIS Express, select Show All Application
from IIS Express in the task bar notification area, then select Stop All
.
如果您正在使用IIS Express,请在任务栏通知区域中选择“显示IIS Express中的所有应用程序”,然后选择“停止所有应用程序”。
Now re-run your application.
现在重新运行您的应用程序。
#1
26
This problem usually occurs when some process such as loading huge data to memory stream and your system memory is not capable of storing so much of data. Try clearing temp folder by giving the command
当某些进程(如将大量数据加载到内存流中以及系统内存无法存储如此多的数据)时,通常会出现这种问题。通过给出命令来尝试清除temp文件夹。
start -> run -> %temp%
启动->运行-> %temp%
#2
10
Running in Debug Mode
在调试模式下运行
When you're developing and debugging an application, you will typically run with the debug attribute in the web.config file set to true and your DLLs compiled in debug mode. However, before you deploy your application to test or to production, you should compile your components in release mode and set the debug attribute to false.
在开发和调试应用程序时,通常使用web中的debug属性来运行。配置文件设置为true, dll在调试模式下编译。但是,在将应用程序部署到测试或生产环境之前,应该以发布模式编译组件,并将debug属性设置为false。
ASP.NET works differently on many levels when running in debug mode. In fact, when you are running in debug mode, the GC will allow your objects to remain alive longer (until the end of the scope) so you will always see higher memory usage when running in debug mode.
ASP。在调试模式下运行时,NET在许多级别上的工作方式都不同。实际上,当您在调试模式下运行时,GC将允许您的对象保持更长的生命周期(直到作用域结束),因此在调试模式下运行时,您将始终看到更高的内存使用量。
Another often unrealized side-effect of running in debug mode is that client scripts served via the webresource.axd and scriptresource.axd handlers will not be cached. That means that each client request will have to download any scripts (such as ASP.NET AJAX scripts) instead of taking advantage of client-side caching. This can lead to a substantial performance hit.
在调试模式下运行的另一个经常未实现的副作用是通过webresource服务的客户端脚本。axd scriptresource。axd处理程序不会被缓存。这意味着每个客户端请求都必须下载任何脚本(如ASP)。NET AJAX脚本)而不是利用客户端缓存。这可能会对性能造成重大影响。
来源:http://blogs.iis.net/webtopics/archive/2009/05/22/troubleshooting-system-outofmemoryexceptions-in-asp-net.aspx
#3
10
Another thing to try is
另一件值得尝试的事情是
Tools -> Options -> search for IIS -> tick Use the 64 bit version of IIS Express for web sites and projects.
工具->选项->搜索IIS -> tick使用64位版本的IIS Express用于web站点和项目。
#4
5
I just restarted Visual Studio and did IISRESET which solved the problem.
我重新启动了Visual Studio并进行了IISRESET,解决了这个问题。
#5
4
If you're using IIS Express, select Show All Application
from IIS Express in the task bar notification area, then select Stop All
.
如果您正在使用IIS Express,请在任务栏通知区域中选择“显示IIS Express中的所有应用程序”,然后选择“停止所有应用程序”。
Now re-run your application.
现在重新运行您的应用程序。