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 protected]> 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 protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> 
>>> On Mar 26, 2015, at 9:04 AM, Michael Domino 
>>> <[email protected] 
>>> <mailto:[email protected]>> 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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to