Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > OutOfMemoryException

Reply
Thread Tools

OutOfMemoryException

 
 
Hardy Wang
Guest
Posts: n/a
 
      02-01-2006
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.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      02-02-2006
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.)


 
Reply With Quote
 
 
 
 
Hardy Wang
Guest
Posts: n/a
 
      02-02-2006
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.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.)
>
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      02-03-2006
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.)

 
Reply With Quote
 
brianfairchild brianfairchild is offline
Junior Member
Join Date: Jun 2008
Posts: 1
 
      06-03-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.OutOfMemoryException: Out of memory. Versteijn ASP .Net 7 03-07-2008 06:57 PM
Exception of type System.OutOfMemoryException is thrown =?Utf-8?B?U3Rhbg==?= ASP .Net 11 12-28-2004 07:00 PM
OutOfMemoryException Error: Garbage Collector doesn't release memory to OS Pyramis ASP .Net 0 01-25-2004 04:37 PM
OutOfMemoryException =?Utf-8?B?amF6?= ASP .Net 2 12-16-2003 12:41 AM
Base Exception:System.OutOfMemoryException error message =?Utf-8?B?UmlwdWwgSGFuZGE=?= ASP .Net 1 11-18-2003 07:52 AM



Advertisments