?
Solved

Trying to find memory leak in process

Posted on 2012-03-09
3
Medium Priority
?
224 Views
Last Modified: 2012-03-13
I have a backend process that is called periodically by a service.  It checks a directory to see if there are any messages to handle.  QA tells me that if the service is running, even if it isn't processing any messages, it causes gradual memory usage increase.  An almost identical service (from which I copied my service) doesn't cause memory usage to increase.

I'm hoping to be able to see the memory usage increase when I run the service on my local machine, so I can comment out the various processes one at a time to figure out where the leakage is occurring, but I'm not sure how to do it.  There is a single entry method that the process uses, so I'm hoping if I take my snapshot and the beginning and end of the method, I should be able to tell if there was anything left open.

What could I use to gather this information in a way that would tell me if memory leakage was occuring inside a particular method?
0
Comment
Question by:FrancineTaylor
[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 Comments
 
LVL 5

Accepted Solution

by:
sujithmd earned 2000 total points
ID: 37704310
You can configure performance counters (please find the list below ) for some time and analyze the same with a utility called PAL which will tell a process is leaking memory or not.

technet.microsoft.com/en-us/library/cc768048.aspx

NB: ensure that your permanence log not too large else you won't be able to analyze anything.
0
 
LVL 13

Expert Comment

by:iHadi
ID: 37705182
The CLR components and garbage collection differs according to the hardware and system resources (optimization stuff), so emulating the exact memory behavior happening on a server on your PC is not a simple task.

I suggest you use a .NET CLR memory profiling software by installing it on the production system.

You can also submit the code of that 'particular' method here so the experts can help you more and point out any code that is causing the memory leaks.
0
 
LVL 3

Expert Comment

by:algorith
ID: 37705211
Is your service written in C#?  Microsoft states "Because of the garbage collection package that is implemented in the Microsoft .NET Framework, it is not possible to have a memory leak in managed code. "

(although it is possible in unmanaged code)

OTOH in C++ you can use the "debug heap" and the "Heap State Reporting Functions"
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

800 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