Solved

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

Posted on 2008-06-12
4
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web site error 3 50
How do I generate a CSR on our root CA server? 1 34
Want Win 10 Pro to search like Server 2010 or 2012 27 108
Time server on domain 3 16
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

763 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