| Author |
Message |
mdgarrett
Joined: 11 Aug 2011 Posts: 5
|
Posted: Thu Aug 11, 2011 8:53 pm Post subject: Snapshot Causes Unmanaged Allocation Growth |
|
|
| Had a report of a memory leak in an application, have been trying to verify the leak but unfortunately I am hitting a bit of a road block. The application does have some win32 calls, and in the past, I've used the profiler to help determine if some of my DLLs which were being marshalled had a leak in them. I now am noticing (perhaps this has always been there?) that taking a snapshot seems to raise the unmanaged allocation. To test this, I created a blank windows form and then profiled it. If I take snapshots fairly close together, the unmanaged allocation starts rising pretty quickly. If i leave it sit there for hours, it stays exactly the same. Is this expected? If so, is there a reliable way to use this product to test more than managed memory leaks? I do understand the product can't profile my instances, calls, etc. in the win32 calls, and i'm ok with this, but it would be nice to be able to tell, at a glance, if the unmanaged allocation was rising continuously with the utility. This way I could at least confirm/deny whether or not the win32 calls are leaking at all. |
|
| Back to top |
|
 |
mdgarrett
Joined: 11 Aug 2011 Posts: 5
|
Posted: Thu Aug 11, 2011 9:22 pm Post subject: |
|
|
| Also, I'm using version 7.0.0.731 of the Memory Profiler utility. The application I used to test was a .net windows form compiled in VS 2008 with framework 3.5. |
|
| Back to top |
|
 |
mdgarrett
Joined: 11 Aug 2011 Posts: 5
|
Posted: Thu Aug 11, 2011 9:49 pm Post subject: |
|
|
| Not sure if this helps at all, but I did this test with a console app as well. It took numerous snapshots before it raised at all. It definitely raises much more slowly, which is probably why I've never noticed it before. I rarely do much work with non-service type applications, and when I do, usually they are more console based applications. This is the first GUI app that makes win32 calls that i've ever tested with the Memory Profiler utility.. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6346 Location: Red Gate Software
|
Posted: Mon Aug 15, 2011 9:47 am Post subject: |
|
|
Hi,
This seems consistent with the way ANTS Memory Profiler works because part of it does run inside the process being profiled. When you request a snapshot, it goes through the process and gets information about all of the objects on the heap, and the API that Microsoft provide for us to do this is implemented as a COM component, meaning all of the activity this component does is going to use umanaged resources.
We should be freeing that memory once the results are collected and passed back to the main application through the pipe, though. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
mdgarrett
Joined: 11 Aug 2011 Posts: 5
|
Posted: Thu Sep 01, 2011 4:47 pm Post subject: |
|
|
Thanks for the reply, and sorry for my slow reply on this issue. Do you know if this is a known bug then? Is this resolved in the latest release?
Can upload program, results of analysis, etc. to demonstrate error. It also grows much more rapidly for a windows GUI app than a console. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6346 Location: Red Gate Software
|
Posted: Fri Sep 02, 2011 9:20 am Post subject: |
|
|
It's part of the design. Profiler has to store some objects in your process' memory space. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
mdgarrett
Joined: 11 Aug 2011 Posts: 5
|
Posted: Fri Sep 02, 2011 12:20 pm Post subject: |
|
|
Ok, I understood that part, but then you mentinoed this, which through my understanding off:
| Quote: |
| We should be freeing that memory once the results are collected and passed back to the main application through the pipe, though. |
Thought you meant that this allocation should eventually become free, which is something I've not seen.[/quote] |
|
| Back to top |
|
 |
|