• 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
Garbage Collection: memory limits, crash when using "lots" of memory, why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Garbage Collection: memory limits, crash when using "lots" of memory, why?


  • Subject: Garbage Collection: memory limits, crash when using "lots" of memory, why?
  • From: Sean McBride <email@hidden>
  • Date: Wed, 21 Sep 2011 13:26:52 -0400
  • Organization: Rogue Research Inc.

Hi folks,

I seem to recall that with GC, one is limited to some amount of 'collectable' memory, but I can no longer find what that limit is.  IIRC, it's like 30 GB?

My 64 bit-only, GC-only app is crashing when I use "lots" of memory.

I can repro in a test app with this pseudo code:

- IBAction method for an NSButton:
  - create 10 MB NSMutableData
  - loop 20 times
    - use mutableCopy on the NSData

In a retain-release app, I can click this button many times, exhaust physical RAM, thrash, and get Activity Monitor's 'virtual memory' column up to at least 12 GB.  No crash.

In a GC app, it crashes every time Activity Monitor shows around 4 GB usage:

#0	0x7fff81cfc4fe in -[NSConcreteMutableData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]
#1	0x7fff81cfc454 in -[NSData(NSData) initWithData:]
#2	0x10000174c in -[TestAppDelegate handleButton:]
...

Surely this should not be so?

Thanks for any suggestions,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Follow-Ups:
    • Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?
      • From: Greg Parker <email@hidden>
    • Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?
      • From: Don Quixote de la Mancha <email@hidden>
  • Prev by Date: Re: how to get rid of NSSavePanel's AccessoryView's border
  • Next by Date: Alternate default text of the sheet that appears when an unsaved document is attempted to be closed
  • Previous by thread: Re: Symbolic Breakpoints
  • Next by thread: Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?
  • Index(es):
    • Date
    • Thread