RE: System.OutOfMemoryException was thrown -- how to debug?



From your description, you have many ASP.NET webservices deployed on a
windows 2003 server (as IIS 5 process isolation mode). Recently, you begin
to get outOfMemory Exception,correct?

You are correct.

Based on my experience, such OOM exception is likely due to some incorrect
memory allocation that produce memory fragment. Firstly, I'd like to
confirm that whether all the ASP.NET webservice or other web applications
on the server has been configuerd as release mode (set <compilation
debug="false"> in web.config)? This is very important.

Does this have to do with just using web services? We're not producing any
ASP.NET web pages, a Windows Forms client is using SOAP messages to access
the server. I actually tried to find out from the web if the <compilation>
settnig has anything to do with web services, but only found it being
mentioned along with web-based applications. But if you know that this is
important also for Web Services, I'll definitely give it a go.

application contribute mostly in the memory consumption. To do this, you
may need to isolate application one by one(run only one application each
time).

We basically need to run the SOAP interface as one application, but I think
the client could switch to using application pools as well if I requested.

For memory leak issue in .net application, we usually need to detect
whether the leak is due to managed memory or native memory. To check this,
we can use the following two performance counters:

** process--- Private Bytes

** .NET CLR Memory --- #Bytes In All Heaps

Managed memory is included in the "Private Bytes" counter, so "Private
Bytes" will rise whether your leak is managed or native. Incidentally, this
is why one can not determine whether a leak is managed or native from Task
manager's "VMSIZE column". VMSIZE column represents Private Bytes only.

Thanks for the info, this definitely helps me figure out whether it's an
unmanaged component that's hogging memory.

even use it to debug .net application with the SOS extension. Here are some
good msdn reference introducing production debugging:
#Introduction to Production Debugging for .NET Framework Applications
http://msdn.microsoft.com/library/en-us/dnbda/html/dbgch01.asp?frame=true
#Debugging Memory Problems
http://msdn.microsoft.com/library/en-us/dnbda/html/DBGch02.asp?frame=true
BTW, based on the complexity of the issue, it may require some thorough
debugging to get the root cause. Therefore I would suggest you consider
contact CSS product support service if you feel it an urgent issue.

You may be right. But I think we'll try to isolate the issue a bit further.
Debugging complex issues is generally not a problem, although it's good to
know that help is also available if we can't figure this one out in due time
ourselves.

Thanks for the help so far,
Jarno
.



Relevant Pages

  • help debugging errors
    ... set the debugging information to teh recommended 'Kernel ... Memory Dump' and waited for a crash. ... Loading Kernel Symbols ...
    (microsoft.public.windowsxp.general)
  • RE: System.OutOfMemoryException was thrown -- how to debug?
    ... memory allocation that produce memory fragment. ... Managed memory is included in the "Private Bytes" counter, ... For managed memory debugging, there has some profiler tools such as the ... contact CSS product support service if you feel it an urgent issue. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Crashdump Win2k Server
    ... I'm afraid that mini dump is too limited to analyze and obtain enough ... I suggest that you config "Write debugging information" to Complete memory ...
    (microsoft.public.windows.server.general)
  • Re: problems with PC crashing; help/insight requested
    ... This is going to be a bit lengthy, including two logs of the windows debug ... Loading Kernel Symbols ... Use!analyze -v to get detailed debugging information. ... 8051cd0f, address which referenced memory ...
    (microsoft.public.windowsxp.general)
  • Re: A debugging implementation of malloc
    ... about a debugging implementation of malloc. ... releaseleaks the memory that's passed to it, ... through a lot of allocations and releases and expect the ...
    (comp.lang.c)

Loading