Re: Memory usage: Xcode vs. Instruments, who is right?
Re: Memory usage: Xcode vs. Instruments, who is right?
- Subject: Re: Memory usage: Xcode vs. Instruments, who is right?
- From: Han Ming Ong <email@hidden>
- Date: Fri, 06 Dec 2013 21:51:40 -0800
On Dec 6, 2013, at 8:50 PM, Robert Martin <email@hidden> wrote:
> I’m truly surprised.
>
> My app, which uses core audio and quicktime, simply grows in its Xcode memory footprint the moment I launch it. Without doing anything in the app, the footprint just grows and grows - if I wait long enough, it passes 100 Megs, and keeps climbing.
I’m pretty sure that Activity Monitor will show you the same trend. If not, please file a bug on Xcode.
Like Scott mentioned, you may have configured your options in the Scheme Editor to keep memory around for diagnostic reasons…
> If I watch the app after I run an archived version in ‘top’ or ActivityMonitor, it does nothing of the sort. It maintains a static footprint of around 20 Megs.
An archived version in built using Release build configuration. Incidentally, Xcode can attach to that process and still show memory report. It should show the same 20 Megs as Activity Monitor.
>
> Something must be seriously wrong - I simply don’t believe the Xcode memory report.
Please file bug since the worst thing that we want is to mislead you. Let me know the radar number.
>
> Rob
>
> On Dec 6, 2013, at 4:45 PM, Han Ming Ong <email@hidden> wrote:
>
>> Markus,
>>
>> If your app is running on the Mac, Xcode’s memory report will show the same number as Activity Monitor’s ‘Memory’ number. That’s because Xcode and Activity Monitor (for that matter, /usr/bin/top) make the same system call to understand your app’s memory usage. Of course we don’t have Activity Monitor nor ‘top’ for your iOS app. Regardless, Xcode makes the same system call on iOS to get your app’s memory usage. One of the reasons that you don’t see the memory drop could be because the system has not reclaimed the freed memory from your app. It uses different heuristics to make that determination. Try this : when your app is running and you switch to another app that consumes a lot of memory, check if Xcode reports a drop in memory usage. I wouldn’t rule out a bug in Xcode’s implementation and so please file a bug if you think there is a problem. We would love to investigate the issue.
>>
>> Xcode records a lot less because it doesn’t want to slow down the target application since you are not in a ‘profiling’ mode per se. Instruments records a lot more info and can know when objects are allocated/deallocated. It can let you know accurately if your application is leaking memory.
>>
>> I’m not surprised that both Xcode and Instruments report the same high water mark.
>>
>> In summary, Xcode gives you a live picture of your memory usage trend. Instruments allows you to deep dive to confirm if you are leaking memory or not.
>>
>> Han Ming
>
_______________________________________________
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