Solved

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

Posted on 2008-06-12
4
386 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now