0

当我尝试构建应用程序的发布版本时出现此错误。对于一个相当大但远不及 400+MB(以 KB 为单位)的文件,它会引发错误

Out of memory allocating 455627472 bytes after a total of 0 bytes
Command /Developer/Platforms/iPhoneOS.platform/developerusr/bin/gcc-4.2 failed with exit code 1

我的硬盘上有 3GB 的可用内存(超过 6GB)、充足的 CPU 能力和 50GB 的可用空间。什么可能导致此问题?

我发现了一些关于该错误的附加信息:

这是我发现的有关该错误的更多信息:

cc1obj(19764) malloc: *** mmap(size=455630848) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

cc1obj: out of memory allocating 455627472 bytes after a total of 0 bytes
{standard input}:unknown:Undefined local symbol L_objc_msgSendSuper2$stub
{standard input}:unknown:Undefined local symbol L_objc_msgSend$stub
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_SUP_REFS_$_0
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_26
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_23
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_25
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_5
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_REFERENCES_$_2
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_19
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_16
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_15
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_20
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_REFERENCES_$_5
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_2
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_21
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_24
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_22
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_11
{standard input}:unknown:Undefined local symbol L_OBJC_CLASSLIST_REFERENCES_$_4
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_12
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_13
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_14
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_18
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_17
{standard input}:unknown:Undefined local symbol L_OBJC_SELECTOR_REFERENCES_10
Command /Developer3.1Final/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
4

3 回答 3

0

NM,没看到是cc2obj死了。

于 2010-06-20T08:29:11.050 回答
0

如果这是在实际构建过程中,那么我猜你的 Mac 需要重新启动或重新安装 Xcode。你永远不需要那么多 RAM 来编译,所以它是递归的或类似的。我怀疑你是否可以编写一些代码来导致这种情况,除非 gcc 有问题。

于 2010-06-20T08:39:07.767 回答
0

我已经看到了,这不是实际的内存错误...

发生的事情是您将 Xcode 目标构建设置设置为发布或调试,并将“优化级别”的特定设置设置为快速、或更快或最快..

那里似乎有一个错误,将其设置为无,或尝试使用 Os 或 O3(我认为不会影响最快)..

这很可能会解决遇到此线程的某人的问题。请务必先尝试“无”...这将确认这是在某人看到此情况时发生的情况...

我可以说 McPragma 肯定有这个问题,因为他/她描述了从调试到发布的变化,这会导致它(调试已经设置为无)并且发布设置为其他东西......在这种情况下...肯定是那个特定的构建设置...

于 2011-09-23T02:49:34.793 回答