iOS NSAllocateMemoryPages failed raised by -[NSData dataWithBytes: length:]

Viewed 3028
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** NSAllocateMemoryPages(10969344) failed'

I have been seeing this exception several time, but it's not reproducible. From crash report, I know it crashed after -[NSData dataWithBytes:] this line. I searched for answer but I couldn't find one 100% convincing to me.

  1. Could that be caused by trying to alloc memory and exceed heap memory limit?
  2. If yes, how to solve it other than optimizing overall application memory management?
  3. If no, what couldn't cause this crash?

Thank!!

0 Answers
Related