Solved

Need assistand in troubleshooting a possible memory leak in a web application

Posted on 2008-06-12
4
389 Views
Last Modified: 2013-12-01
I have a web application that I wrote that appears to a have a memory leak somewhere and I need a little help trying to track this down.  The application runs very well for a period of time and then all of a sudden (within seconds), the Peak Mem Usage shoot to 1.3GB.  This can happen at any time and it appears to be random.  At some point, I assume that Garbage Collection (GC) is happening and the Mem Usage returns to approxiamtely100MB.  However, once this happens, the site becomes sluggish and I can see sales dropping off.

What I have done so far is install the Debug Diagnostic tools and started a monitor for Leak Memory against the w3wp.exe process for the web site.  I waited for a couple of hours and when it happened, it wrote out 2 dump files for me to analyze.

To be totaly honest, I do not know that much about this tool and I don't really have a good grasp as to what I am looking at.  So, can anyone help point me into the right direction as to how to begin tracking down the particular module or code that is causing the problem.

Thanks in advance!
0
Comment
Question by:manrysj
  • 3
4 Comments
 
LVL 13

Accepted Solution

by:
SagiEDoc earned 500 total points
ID: 21770765
In IIS under your default application pool right click and select properties, under the recycling tab try setting the recycle worker process after consuming to much memory, set this to around 900MB. What it will do is reset the worker process when memory usage hits 900MB, active sessions are written to a temp file and inactive sessions are discarded so you free some of the dead weight so to speak. When the process recycles cpu usage will peak and then stablise if this happens to often consider moving the limit up to say 1024MB. Play around with these settings till you get the desired result. Avoid a hard recycle every x minutes or after x number of requests. You can add a recycle at a certain time, but I would make that time out of production hours.
0
 

Author Comment

by:manrysj
ID: 21770940
Thanks for the response.  I am familiar with that option and I have used that before.  By doing that, am I simply using a "band-aid" for the real problem?  I set that to recycle the application pool several weeks ago but it then disabled the application pool entirely after it had a few problems.  I noticed that around the same time the dump file was created by Debug Diagnostic, there was an application event log with an Error that stated:

The state server has closed an expired TCP/IP connection. The IP address of the client is 127.0.0.1. The expired Read operation began at 06/12/2008 09:24:19.

I don't mind using your suggestion, but I am the developer of the web site and can change any code if I can narrow down the problem.  Also, I have never had this problem before on any other web site that I have created but this website is the busiest I have ever developed.

I am attaching the advanced analysis report from the dump file in case someone can spot something in there that could be a problem.
MemoryDumpReport.pdf
0
 

Author Comment

by:manrysj
ID: 21778730
I have found the trouble spot.  It is an upload component that I use for uploading files to the web server.  It is receiving an OutOfMemoryException error.  It doesn't alwasy happen, but when it does, it is bad.  I am going to award the point to SagiEDoc for his recommendations.
0
 

Author Closing Comment

by:manrysj
ID: 31466592
Although the solution did provide a fail safe option, it was not the exact solution to the problem.  But, I do appreciate the information and I have implemented your suggestions as a fail safe solution until the software vendor can provide me with an update.  Thanks again.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question