Re: Clang vs. gcc and random crashes
Re: Clang vs. gcc and random crashes
- Subject: Re: Clang vs. gcc and random crashes
- From: Steve Christensen <email@hidden>
- Date: Thu, 26 Mar 2015 11:44:47 -0700
I noticed that your code calls [NSApp runModalSession:session] in a tight loop. Is it possible that that is allocating memory on each call without an autorelease pool to free it? If so then having guard malloc turned on may mean that your app is running out of memory a lot faster than it would if it were turned off, and that you may run into the same situation if you wait long enough.
If the 10 second crash time with guard malloc is pretty consistent then an easy test would be to add an autorelease pool inside your loop and see if the crash goes away.
On Mar 26, 2015, at 9:57 AM, Michael Domino < email@hidden> wrote:
Absolutely right, I had to turn off guard malloc, and this problem went away.
On Mar 26, 2015, at 12:18 PM, Jens Alfke < email@hidden> wrote:
On Mar 26, 2015, at 9:04 AM, Michael Domino < email@hidden> wrote:
This is a 32-bit app, running on 10.10.2. Why would this be happening? Any ideas? Thanks in advance!
GuardMalloc[Identity Finder-61163]: Failed to VM allocate 16384 bytes
GuardMalloc[Identity Finder-61163]: Explicitly trapping into debugger!!!
It ran out of address space, i.e. allocated 2GB* of memory. This is entirely possible when using GuardMalloc because it puts every heap allocation on a separate 4k-byte memory page, which tends to hugely increase the amount of memory allocated.
I think you’ll need to either turn off GuardMalloc, or run your app as 64-bit.
—Jens
* IIRC that’s how much address space is available to a 32-bit process. Or it might be 3GB. The rest of the full 4GB is reserved by the kernel.
|
_______________________________________________
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