• 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: vm keeps increasing when in a rigorous loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vm keeps increasing when in a rigorous loop


  • Subject: Re: vm keeps increasing when in a rigorous loop
  • From: Fritz Anderson <email@hidden>
  • Date: Sun, 08 Jul 2012 13:33:39 -0500

On 8 Jul 2012, at 1:06 PM, Nick Rogers wrote:

> But the app is GC enabled (required), so the VM size should reset to some level every few seconds, but doesn't.

Revise your mental model of garbage collection. It runs periodically on a thread and doesn't collect all garbage at every sweep, so you have no way of knowing when it will catch your allocations. So far as you are concerned, it is nondeterministic. And if that -addPointerToATree: method goes into Cocoa at all, you should assume Cocoa is allocating and rooting memory in ways you don't have control over.

Also, chasing VM size in Activity Monitor is a fool's game, as futile as watching retain counts. The VM size simply counts the total span of addresses that your code has _touched_, not how much RAM is active at the moment. The closest thing you should be looking at is private memory, and even that isn't 100% reliable. Use Instruments to determine whether you have an actual leak.

	— F


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >vm keeps increasing when in a rigorous loop (From: Nick Rogers <email@hidden>)

  • Prev by Date: identifying if an application is not responding
  • Next by Date: Re: identifying if an application is not responding
  • Previous by thread: vm keeps increasing when in a rigorous loop
  • Next by thread: Re: vm keeps increasing when in a rigorous loop
  • Index(es):
    • Date
    • Thread