是否有一个ASP.Net应用程序的任何内存限制? [英] Is there any memory restrictions on an ASP.Net application?

查看:139
本文介绍了是否有一个ASP.Net应用程序的任何内存限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net MVC应用程序,允许用户上传图片。当我尝试上传一个真正的大文件(400MB)我得到一个错误。

I have an ASP.Net MVC application that allows users to upload images. When I try to upload a really large file (400MB) I get an error.

我认为我的图像处理code(家酿)是非常低效的,所以我决定我会尝试使用第三方库来处理图像处理部分。

I assumed that my image processing code (home brew) was very inefficient, so I decided I would try using a third party library to handle the image processing parts.

由于我使用的是TDD,我想先写一个失败的测试。但是,当我测试控制器行动同样大的文件时,它能够做所有的图像处理没有任何麻烦。

Because I'm using TDD, I wanted to first write a test that fails. But when I test the controller action with the same large file it is able to do all the image processing without any trouble.

我得到的错误是内存不足。

The error I get is "Out of memory".

我敢肯定,我的code可能是使用了大量的内存比实际需要的,但我只是想知道为什么我的测试通过。

I'm sure my code is probably using a lot more memory than it needs to but I just want to know why my test passes.

另一个区别是,我使用的是不与测试使用SWFUpload的。难道这是原因?

The other difference is that I'm using SWFUpload which is not used with the test. Could this be the cause?

推荐答案

有可能无论是在web.config中或machine.config中,或两者配置的内存限制。

There can be memory limits configured in either the web.config or machine.config, or both.

在web.config中的部分是:

In web.config the section is:

<httpRuntime 
executionTimeout="3600" 
maxRequestLength="102400"
/>

在Machine.config中的部分也可以是部分的httpRuntime,类似于:

In machine.config the section can also be the httpRunTime section, similar to:

<httpRuntime 
executionTimeout="90" 
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false" 
minFreeThreads="8" 
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>

该ASPNET过程也可以仅限于使用中processModel部分的总内存的百分比,请参见:

The aspnet process can also be limited to a percentage of the total memory using the processModel section, see:

http://msdn.microsoft.com/en-us/library/ 7w2sway1.aspx

我遇到的问题similiar给你的那些设置描述的原因之一。

尤其是中processModel memoryLimit属性。

I've encountered similiar problems to the one you described cause by those settings.
In particular the ProcessModel memorylimit attribute.

这篇关于是否有一个ASP.Net应用程序的任何内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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