Re: ASP.NET application hits 2GB virtual bytes



re:
!> we essentially had a resource/memory leak

It certainly looked that way to me.

re:
!> the Reflection call failed but the watcher thread was not cleaned up

Interesting! Thanks for the info/update.

re:
!> For those that are interested, we found the culprit of the leak using the ANTS Profiler tool.

And a great tool it is!

If you read this, please send a summary of the problem/resolution to Walter Wang.

He posted that request in a reply to this thread and wants to see if the
Enterprise Library can be improved so that type of problem can be prevented.

Thanks...and congratulations on the resolution!



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Robert Slaney" <Robert Slaney@xxxxxxxxxxxxx> wrote in message
news:8B8F4070-AED0-4979-8478-693F1163F885@xxxxxxxxxxxxxxxx
Hi Juan,

Thanks for the detailed reply.

We found the problem last night, we essentially had a resource/memory leak.

We use the MS Enterprise Library for some logging and we had a invalid
assembly reference (in config) for a LogSink. The Configuration block loads
up a FileWatcher on a background thread ( looking for changes to web.config )
before attempting to load the LogSink for the first time. As the assembly
reference was incorrect, the Reflection call failed but the watcher thread
was not cleaned up.

When the assembly reference was corrected, the issue disappeared.

... so there is a bug in the June 2005 drop of the MS Enterprise Library
that manifests itself if a bad config is used.

The aspnet_wp process itself never used more than 300 MB of RAM during this
entire scenario so the limit was never reached for recycle.

For those that are interested, we found the culprit of the leak using the
ANTS Profiler tool.

Cheers...

Rob

"Juan T. Llibre" wrote:

Hi, Robert.

re:
!> The server it is being tested on has 4GB of RAM, with the 3GB switch on boot.

The 3GB switch limits the *virtual address space*, not the working memory set.

re:
!> <processModel enabled="true" memoryLimit="20" ... />
!> According to the documentation this should have
!> limited the virtual bytes to approx 800 MB for the process

Since, if you use the 3GB switch, you have 3GB for user mode virtual address space
and 1GB of kernel mode virtual address space, and kernel mode virtual address space
is not available to applications, you should be seeing physical RAM top out at 600MB
( 20% of the available 3GB user mode address space ) ...and your application recycling at that point.

20% is way too little for IIS and ASP.NET to function efficiently.
Try setting that to at least 40-50%. The default is 60%.

You need to distinguish between memory usage and virtual address space.

The term "address space" refers to how a numerical value (known as an "address")
is interpreted when it is used to access some type of resource.

There is a physical address space; each address in the physical
address space refers to a byte in a memory chip somewhere.

The virtual address space is the set of possible pointer values
(addresses) that can be used at a single moment by the processor.

If you have an address like 0x12345678, the virtual address space
determines what you get if you try to access that memory.

The contents of the virtual address space changes over time, as you allocate and free memory.
It also varies based on context: each process has its own virtual address space.

Saying that 2GB or 3GB of virtual address space is available to user mode means that at
any given moment in time, out of the 4 billion virtual addresses available in a 32-bit value,
2 billion (or 3 billion) of them are potentially usable by user-mode code.

What I would suggest is taking a look at your code and seeing which
processes are causing the extremely large usage of virtual memory.

Maybe Process Explorer could give you an inkling as to which processes are hogging your memory.
Download it from : http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx

The processes' images will have some info for you.

That said, your basic problem is that you're running in IIS 5.0 compatibility mode.

When a server is running in IIS 5.0 isolation mode, application pools,
***recycling***, and health monitoring features are unavailable.

That makes debugging memory processes a tad more difficult,
and that recycling is not available is the reason why you are seeing RAM use run to 2GB.

Is there any reason you're running IIS 5 isolation mode ?

Can you switch to IIS 6.0's worker process isolation mode ?

If you can do that ( IIS 5.0 compatibility is not too-often needed ),
you'll be able to use recycling...and your IIS processes will keep themselves healthy.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Robert Slaney" <Robert Slaney@xxxxxxxxxxxxx> wrote in message
news:28ECCC06-366E-46B5-A36C-EAE6CC33F816@xxxxxxxxxxxxxxxx
We have a problem with a ASP.NET web application that is experiencing
OutOfMemory Exceptions. On analysis we have noticed that the Virtual Bytes
of the aspnet_web process ( running IIS5 Mode on Win2K3 ) hits the 2GB mark.

The server it is being tested on has 4GB of RAM, with the 3GB switch on boot.

We have also added the following to the machine.config

<processModel enabled="true" memoryLimit="20" ... />

According to the documentation this should have limited the virtual bytes to
approx 800 MB for the process.

Can anyone shed any light on this, or suggest other measurements / settings
we should be looking at ?

Cheers...

Rob





.



Relevant Pages

  • Re: ASP.NET application hits 2GB virtual bytes
    ... The server it is being tested on has 4GB of RAM, with the 3GB switch on boot. ... The 3GB switch limits the *virtual address space*, not the working memory set. ... your basic problem is that you're running in IIS 5.0 compatibility mode. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: w3wp.exe memory problem
    ... While I do not know what the problem you are currently seeing, IIS6 has good ... Restarting IIS is NOT the only way to fix this problem. ... IIS6 has process recycling options based on private memory ...
    (microsoft.public.inetserver.iis)
  • Re: ASP.NET application hits 2GB virtual bytes
    ... The server it is being tested on has 4GB of RAM, with the 3GB switch on boot. ... The 3GB switch limits the *virtual address space*, not the working memory set. ... your basic problem is that you're running in IIS 5.0 compatibility mode. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: memory used for inetinfo.exe
    ... check the logs everyday. ... I just noticed the memory was up to 300 megs ... things that people have seen with IIS. ... >> having to restart this service or other services. ...
    (microsoft.public.inetserver.iis.security)