Red Gate forums :: View topic - Snapshot Causes Unmanaged Allocation Growth
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Snapshot Causes Unmanaged Allocation Growth

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mdgarrett



Joined: 11 Aug 2011
Posts: 5

PostPosted: Thu Aug 11, 2011 8:53 pm    Post subject: Snapshot Causes Unmanaged Allocation Growth Reply with quote

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
View user's profile Send private message
mdgarrett



Joined: 11 Aug 2011
Posts: 5

PostPosted: Thu Aug 11, 2011 9:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
mdgarrett



Joined: 11 Aug 2011
Posts: 5

PostPosted: Thu Aug 11, 2011 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6643

PostPosted: Mon Aug 15, 2011 9:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mdgarrett



Joined: 11 Aug 2011
Posts: 5

PostPosted: Thu Sep 01, 2011 4:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6643

PostPosted: Fri Sep 02, 2011 9:20 am    Post subject: Reply with quote

It's part of the design. Profiler has to store some objects in your process' memory space.
Back to top
View user's profile Send private message
mdgarrett



Joined: 11 Aug 2011
Posts: 5

PostPosted: Fri Sep 02, 2011 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group