Page 1 of 1

Memory footprint

Posted: Thu Jul 22, 2010 1:38 pm
I wanted to make sure that the plug-in I’m developing cleans up the resources correctly. In the code, I do not have many dynamic allocations and I believe that I’m cleaning up efficiently. But, getting some hard data will be even more convincing. I have some doubts regarding the same.

- Are there any tools that I can use to properly analyze the memory footprint?

- As a primitive analysis, I used Task Manager “Mem Usageâ€

RE: Memory footprint

Posted: Thu Jul 22, 2010 2:01 pm
by Spacepacket
This may seem obvious, but the best way tell whether a plug-in is leaking memory is to run OmniPeek with your plug-in in the VS debugger. When you quit OmniPeek, the Output tab in the debugger will display a list of the objects that were leaked.

If you have enabled memory leak debugging, it will actually show you where the leaked objects were created. More information about detecting memory leaks is here: ... 80%29.aspx

I have tried using other tools like boundschecker, but have found that for simply finding memory leaks, that they are not much more useful then the debugger output.

Watching memory usage to find memory leaks is very deceiving, because your plug-in is just a small part of all the stuff that's going on. It is a good method for high level memory usage monitoring, but not good for detailed analysis.

To really simplify the capture, and use as little memory as possible, turn off all analysis options, except your plug-in, and make your capture buffer 1MB.

One of the tricks I use to force OmniPeek to its smallest size is to minimize it. This flushes as much of the program as possible out to virtual memory. Of course, as soon as you maximize and start doing stuff, it will get big again.

RE: RE: Memory footprint

Posted: Thu Jul 22, 2010 2:35 pm
That's great info you've given, Spacepacket. Thanks a lot. I will go through the links.

The data given above is without my Plug-in in the plug-ins directory. So is it expected for OmniPeek to consume more memory over-time as the tabs are opened and closed?

RE: RE: RE: Memory footprint

Posted: Thu Jul 22, 2010 3:07 pm
by Spacepacket
Yes. As you open and close captures over time, OmniPeek will consume more memory. This is not because it is leaking memory, but rather it is the nature of the beast. Maybe it is memory fragmentation, or something like that. The same thing happens with apps like IE and FireFox. Sooner or later, they just get so big you have to kill them. They never get smaller. It is OK though, because OmniPeek is a network troubleshooting tool. You run it, you do stuff, and you quit it. If you need a more robust server environment to run apps (plug-ins) longer term, you should use OmniEngine.

RE: RE: RE: RE: Memory footprint

Posted: Thu Jul 22, 2010 3:16 pm
Perfect! The VS debugger is great! Thanks a lot for the tip!!

Yes, I understand about the fragmentation.