Re: What is the Memory graph measuring?
Re: What is the Memory graph measuring?
- Subject: Re: What is the Memory graph measuring?
- From: Han Ming Ong <email@hidden>
- Date: Mon, 24 Apr 2017 09:56:30 -0700
> On Apr 23, 2017, at 6:29 PM, Jens Alfke <email@hidden> wrote:
>
> I’m running a command-line tool that exercises the library I’m developing. (It’s just using SQLite and some simple file I/O via C++ iostreams.) Xcode says it’s using over 90MB of memory, which is crazy; it should be around 5MB. If I expand the memory widget, it shows a histogram showing memory usage rising steeply and linearly as the process runs. Oh no!
>
> But using Xcode’s lovely memory graph, I can’t find anywhere near that much allocated. Most of it is malloc blocks allocated by SQLite, but it’s only about 6MB. And the ‘heap’ command-line tool confirms that my malloc heaps only consume 6MB of memory.
>
> And yet both Activity Monitor and ‘top’ agree that the process is using 90MB. What the heck are they measuring? I have no diagnostics turned on (stack logging, zombies, etc.) that might eat up memory. The memory debugging tools are very nice, but if I can’t trust what they’re telling me, they’re not useful.
As you have confirmed, Activity Monitor, `top` and Xcode’s Memory Report all report the same number and that’s because they are measuring the same memory that’s been given to your process. Instruments and `heap` will tell you the exact memory blocks that your process is currently using.
Having said that, if the histogram shows that the memory is monotonically increasing, then something is definitely asking for more and more memory. In the past, one of the areas is the backtrace recording library. What version of Xcode are you using? Can you try to temporarily turn of backtrace recording in the Scheme editor?
Han Ming
>
> —Jens
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden