Solved

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

Posted on 2008-06-12
4
385 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

14 Experts available now in Live!

Get 1:1 Help Now