开发者

ASP.NET Memory Optimazation

开发者 https://www.devze.com 2022-12-16 16:37 出处:网络
getting: aspnet_wp.exe(PID: 988) was recycled because memory consumption exceeded the 148 MB (60 percent of available RAM).

getting:

aspnet_wp.exe  (PID: 988) was recycled because memory consumption exceeded the 148 MB (60 percent of available RAM).

any suggestion of w开发者_开发知识库eb.config etc optimization? did already all the debug/release compile stuff. but still it takes to fast to much memory. machine got 256mbs ram, on 512mb it runs smooth. want to squeeze it down as much as possible. within code it did also as much to keep memory low, but it kind of 50mb data only. this must be possible. or does the framework need so much?


You can try de-configuring all of the HttpModules that you don't use. Windows Authentication, for example, is a common one.

You might also take a look at any static variables that you're allocating.

Disabling ViewState on as many pages as possible might help a little.

Minimize or eliminate any extra DLLs that get loaded (from your bin directory or the GAC).

However, it's unlikely that you'll save much memory by hunting-and-pecking like that. If you're serious about chasing it down, you'll need a memory profiler tool, such as .NET Memory Profiler from SciTech. They have a free two week trial.


Well, it should fit, but it depends on what you're doing with it, and which version of IIS you're running.

Optimizing Memory Usage (IIS 6.0)

Servers running IIS 6.0 benefit from ample physical memory. Generally, the more memory that you add, the more the servers use and the better they perform. IIS 6.0 requires a minimum of 128 MB of memory; at least 256 MB is recommended. If you are running memory-intensive applications, your server might require much more memory to run optimally — more than the recommended 256 MB of memory.

IIS 7.0 however has somewhat larger requirements:

  • Minimum: 512 MB
  • Recommended: 2 GB or more

That article has a few other recommendations on optimisations you can carry out, I'd also recommend Tess Ferrandez's blog, especially her post ".NET Memory usage - A restaurant analogy" which explains memory allocation nicely, and her other posts on debugging memory usage - which start in a similar place to RickNZ's suggestions.


What are you putting in memory?

256mb is way below what a server would have, even if it was shared server you'd likely have more space to work with than that.

Are you caching?

What OS are you running?

Like RickNZ said trimming as much fat out as you can might save you some memory.

Honestly I think you simply have an unrealistic memory target.

0

精彩评论

暂无评论...
验证码 换一张
取 消