Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

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

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
manrysj
Asked:
manrysj
  • 3
1 Solution
 
SagiEDocCommented:
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
 
manrysjAuthor Commented:
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
 
manrysjAuthor Commented:
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
 
manrysjAuthor Commented:
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now