How to find out where my memory goes

I have a situation where the cycle of loading and closing a document eats up several MB of RAM. This memory does not leak out, because something owns it and clears it when the application exits (visual leak detector and Mac Leaks tool show consent to this). However, I would like to know where this is happening. I assume that this is some kind of cache in the application, which is populated when the document is loaded, but not freed when the document is closed. What methods or tools could I use to find out where these distributions are made?

UPDATE:

Following the Hans post, I added a loop to the application to repeatedly open and close documents. I found that the initial leap in memory usage ("Private bytes," as Process Explorer reports) after loading the first two documents, but then it no longer increases each time. Thus, this suggests that there are no new distributions, and the apparent increase is likely to be associated with the paging artifact.

I also examined in detail the tools on the poppy, which was useful to see where the distribution occurs: create a tool consisting of the Distribution and Leakage tools, then add a heap snapshot at the beginning and end of the loop and it will display in the Heapshots list all delta distributions relative to the last snapshot. This suggests that on the Mac, memory expansion increased, but this was due to internal caches, such as the CoreGraphics graphic, which we have little control over.

+5
source share
4 answers

, RAM, : , . , . , , . , Windows, , .

, : . , . , , . , , , .

+2

, MS CRT . :

+4

, . , : , . XCode , .

Run-> Run with performance Tool-> Leaks
This will launch your application with code that helps you find leaks.
+2
source

May be helpful to someone. I realized that Xcode 4.2 with zombie object detection activated (checkbox in the scheme editor) eats memory like crazy - ~ 4 GB per minute. Just make sure this is checked in cases where your application uses memory under Xcode and otherwise. Memory leaks and memory leaks also do nothing.

0
source

All Articles