• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Allocation Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Allocation Question


  • Subject: Re: Memory Allocation Question
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 28 Feb 2011 20:55:30 -0800

On Feb 28, 2011, at 19:49, Laurent Daudelin wrote:

> When I run my app, scanning my home folder, the memory consumption will go in the 300MB range. Even when I release all the objects I have been allocating, Activity Monitor reports the same amounts of real, virtual and private memory. Those amounts don't go down.

Activity Monitor numbers need to be interpreted *very* carefully. Virtual memory, for example, isn't about how much memory you're using, but how much virtual memory *address space* you're using, whether or not it's actually using memory for all the address space.

> So, I ran my app a few times in Instruments. When I clear all objects I've been using, I am left with about 12KB of leaked memory.

The amount of leaked memory doesn't correlate to the total amount of memory being used (unless you have a rampant runaway). You may have false positives and false negatives, so the Instruments data can be hard to interpret too.

> How can Activity Monitor reports the same numbers while Instruments seems to report what's actually happening? I wouldn't have much problem with my app kinda keeping the same memory it used in subsequent runs but when I do another run, the memory used keeps going up, e.g. it doesn't seem to stabilize.


I'd suggest you give heapshot analysis a try, as in this great B.Bum blog post:

	http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable-memory-growth/

That way you can first eliminate real leaks*, and then start looking at whether your overall usage is excessive even if not leaky.


*And heapshot analysis should help you home in on what's getting allocated each run, even if that doesn't turn out to be any kind of leak.


 _______________________________________________
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

References: 
 >Memory Allocation Question (From: Laurent Daudelin <email@hidden>)

  • Prev by Date: Linking to libcrypto Using 10.6 SDK and Targeting 10.5
  • Previous by thread: Memory Allocation Question
  • Next by thread: Linking to libcrypto Using 10.6 SDK and Targeting 10.5
  • Index(es):
    • Date
    • Thread