Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Trying to find memory leak in process

Posted on 2012-03-09
3
Medium Priority
?
225 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 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