Re: maximum .net process can use
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Thu, 19 Jan 2006 18:02:29 +0100
Zen,
You should read the article carefully, the threshold is an empirical one
based on experiments using a typical application on a version (v1.1) of the
framework. But it's nothing else than a (dirty) trick, it sets the threshold
at such a low level that it forces the process to recycle before you
possibly have a chance to encounter an OOM exception, it's 'dirty' because
it may hide a bug (or design flaw) in your code and it side-steps the LOH
fragmentation problem typical for v1.0 and v1.1 (non SP1) of the framework.
You did change your code to reduce the memory consumption, but still your
memory consumption reaches 1.3 GB, so I guess you did refactor your code
such that there is less (or no?) fragmentation of the LOH. But again, once
the heap becomes too fragmented you are at risk for OOM's. Now the point is
what do you prefer, process recycling or OOM's, for me the two are equally
bad, you didn't pay for 2GB of memory to only use 60% of it didn't you?
So, I repeat it again, profile your web application take a look at the
allocation pattern, that's the only way to prevent/reduce fragmentation in a
server like application. If you can eliminate fragmentation completely, your
application will live a long, well performing and healthy life :-), if you
can't eliminate fragmentation, you will have to live with process recycling
or OOM's, the choice is yours.
Willy.
"Zen" <zen@xxxxxxxxxxxxxx> wrote in message
news:OYrZZDRHGHA.1088@xxxxxxxxxxxxxxxxxxxxxxx
| thanks for the information. By the way, I'm not clear on how the author
of
| the article came up with the 800MB as a good threshold for
"Process\Private
| Bytes"? I restructured my code to reduce memory consumption peak (it's
long
| to explain it but it including removing a website from the server) and
it's
| running fine even when the "Private Bytes" goes up to 1.3G. I suspect
that
| the MEM_RESERVE regions go up for each additional website as well but I
| still don't get the 800MB threshold, could someone explain? Thanks!
|
| Also, I was setting the memory max to 80% instead of 60% hoping to solve
the
| problem. I'm changing it back down to 65% now.
|
|
| "Neyah" <Neyah@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
| news:2A019F44-5E44-4435-8374-552A157D7B7D@xxxxxxxxxxxxxxxx
| > See this info (it's long)
| >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/monitor_perf.asp
| >
| > A quote:
| > First, the likelihood of experiencing an OutOfMemoryException begins to
| > increase dramatically when "Process\Virtual Bytes" is within 600 MB of
the
| > virtual address space limit (generally 2 GB), and secondly, tests have
| > shown
| > that "Process\Virtual Bytes" is often larger than "Process\Private
Bytes"
| > by
| > no more than 600 MB. This difference is due in part to the MEM_RESERVE
| > regions maintained by the GC, allowing it to quickly commit more memory
| > when
| > needed. Taken together this implies that when "Process\Private Bytes"
| > exceeds
| > 800 MB, the likelihood of experiencing an OutOfMemoryException
increases.
| >
| > Long story short, asp.net 1.1 with has a high likelyhood of experiencing
| > OutOfMemoryExceptions once the aspnet_wp.exe process exceeds 800 MB due
to
| > address space limitations and additional reserve by the GC.
| >
| > The below applies to IIS 5.0. For IIS 6.0, you would set this up from
IIS
| > Manager Properties -> Recycling -> Maximum used memory. But one of your
| > other posts indicated you were using Win 2k server, so you don't have
IIS
| > 6.0.
| >
| > The memorylimit defaults to 60% of available RAM, which is why you
didn't
| > have any issues while you only had 1 GB. Now that you have 2 GB,
| > aspnet_wp.exe won't recycle until it reaches 1.2 GB, which is over the
800
| > MB
| > problem point. You'll want to set the memoryLimit in the your
| > machine.config
| > setting for processModel to a value that doesn't exceed 800 MB. For a 2
| > GB
| > machine, 39% will do the trick.
| >
| > If you have enough RAM to where you have included the /3GB switch to
| > boot.ini, you can use a value that calculates out to 1,800 MB instead.
| >
| > I'd also recommend lowering the timout and idelTimout values from
| > Infinite,
| > to a lower value. This will allow the aspnet_wp.exe process to actually
| > recycle.
| >
| > "Zen" wrote:
| >
| >> Hi,
| >>
| >> My production machine has 2G of memory, when aspnet_wp.exe goes up to
| >> about
| >> ~1.2G of memory usage, I start get out-of-memory exception. Other
| >> processes
| >> don't use as much memory and I added all the peak memory usage of all
the
| >> processes (including aspnet_wp.exe), it goes up to no more than 1.5.
| >>
| >> How is that possible? Would anyone know please help? thanks!
| >>
| >>
| >>
|
|
.
- Follow-Ups:
- Re: maximum .net process can use
- From: Neyah
- Re: maximum .net process can use
- References:
- maximum .net process can use
- From: Zen
- Re: maximum .net process can use
- From: Zen
- maximum .net process can use
- Prev by Date: Re: Which PInvokes aren't supported in C# or managed code?
- Next by Date: Re: How to get a sinlge value from a dataview?
- Previous by thread: Re: maximum .net process can use
- Next by thread: Re: maximum .net process can use
- Index(es):
Relevant Pages
|