tags:

views:

86

answers:

3

Hi,

getting:

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

any suggestion of web.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?

+2  A: 

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.

RickNZ
of course, momory profiler. i totally forgot. I try this first. Cut HttpModules down or Dlls may give a bit memory but to risky what it can cause.
csharpnoob
A: 

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.

Joel Barsotti
+1  A: 

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.

Zhaph - Ben Duguid
thanks for all the info, to all of you. i could get my application by serializing on disk, keep only basic routines in memory. it works. but disk access means bad performance. so i'll try all the other suggestion which make sense and does not affect speed nor functionality. but at least it could work.
csharpnoob