OutOfMemoryException

H

Hardy Wang

Hi,
We have a production web server machine, running Win2K + SP4 / IIS 5.0 /
ASP.NET 1.1, it has 2 GB of physical memory.

With the default value of <processModel memoryLimit="60"> of
machine.config, we constantly get OutOfMemoryExcption, then we adjusted the
value to 25, it works fine. If we adjust to 30, we still get this exception.

It looks like when aspnet work process consumes only up to 500MB RAM,
every number beyond that is not accessible by ASP.NET. But we do have 2GB
RAM on the server, and from Task Manager we can see there is quite a lot of
free memory available.

Any reason why ASP.NET does not like to cunsume more memory? Thanks for
any suggestion.
 
S

Steven Cheng[MSFT]

Hi Hardy,

Welcome to the MSDN newsgroup.

From your description, one of your ASP.NET web application(deployed on
production server?) is suffering OutOfMemory exception recently. Also, you
found that this occurs when the processModel's memoryLimit is enlarged
above a certain value, correct?

Based on my experience, this is likely memory leak issue and the OOM
exception occur when you enlarge the "memoryLimit" setting is because there
is leaked memory or memory fragement which cause the system unable to
allocate new block of memory before we make full use of the total physical
memory. For such issue, it'll be hard to directly address the root cause.
Is the web application just deployed recently or has been deployed for long
time and just suffers the problem recently? Here are some general setting
and things we can check first:

1. Locate the <compilation> element in your asp.net application's
web.config file, check the "debug" attribute to see whether it is set to
false. When "debug" attribute is set to "true", the asp.net runtime won't
batch compile the dynamic page classes and assemblies which may easily
cause heap fragment......

2. If possible, we can try isolate the problem to some certain pages
(lookup the private bytes in peformance counters) which is likely lead to
the problem.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
H

Hardy Wang

Thanks Steve,
Let me describe my problem more detail.
Our server seems not to be able to recycle the work process when it hits
the memory limitation when we set value to greater than 30. If we set to 25,
when can see work process is recycled and a new one is created
automatically.
We host about 20 web applications on this server, some of them are quite
busy, while others are not visited so frequently. Whenever
OutOfMomoryException was thrown, all of the applications suffered at the
same time.

Anyway, thanks for your suggestion of "Debug", I definitely will look
into. And we will keep monitoring the system.
 
S

Steven Cheng[MSFT]

Thanks for reply Hardy,

Yes, as for the

========================
Our server seems not to be able to recycle the work process when it hits
the memory limitation when we set value to greater than 30. If we set to
25,
when can see work process is recycled and a new one is created
automatically.
========================

it is just because the memory issue like heap fragment make the availabe
free memory blocks be occupied and if the memory limitation setting is not
greater than 30 (in yoru case) , the asp.net will recycle the worker
process so that you won't encounter the OOM exception, if the setting is
greater, the worker process won't recycle and the memory issue become
serious and finally it raise OOM exception.

Anyway, if there're any new update, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Joined
Jun 3, 2008
Messages
1
Reaction score
0
OOM - Stupid, but check

So I had been dealing with this issue in pages where I dynamically add controls to pages. For example, I have a page that renders itself completely, with events, based on an XML file.

In certain situations If the XML file was large and therefore a lot of controls were to be built on the page I would see my memory spike until I got an OOM.

Trace. I had forgotten to turn trace off, and better yet I had set it to 1000 requests. So, since my code was so dynamic a ton of information was being written to trace and therefore consuming memory like a Thanksgiving dinner!

Make sure you turn trace off in production!

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top