Garbage Collection: memory limits, crash when using "lots" of memory, why?
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