iOS NSAllocateMemoryPages失败引发 - [NSData dataWithBytes:length:]

Jay*_*ang 7 crash memory-management objective-c heap-memory ios

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** NSAllocateMemoryPages(10969344) failed'
Run Code Online (Sandbox Code Playgroud)

我已经多次看到这个例外,但它不可重现.从崩溃报告中,我知道它在 - [NSData dataWithBytes:]这一行后崩溃了.我搜索了答案,但我找不到一个100%令我信服的人.

  1. 这可能是因为尝试分配内存并超出堆内存限制吗?
  2. 如果是,除了优化整体应用程序内存管理之外,如何解决?
  3. 如果不是,什么不能导致这次崩溃?

谢谢!!