简体   繁体   English

为什么FDT在打包适用于iOS的Adobe AIR应用程序(.IPA)时显示Java堆错误

[英]Why Does FDT Show A Java Heap Error While Packaging an Adobe AIR app for iOS (.IPA)

I'm creating some flash game using Adobe AIR. 我正在使用Adobe AIR创建一些Flash游戏。 I try to compile it into .ipa file (to run on iPad device). 我尝试将其编译成.ipa文件(以在iPad设备上运行)。

The project is not big, but not small also (it uses 6 swc libraries and lot's of not precompiled code). 该项目不大,但也不小(它使用6个swc库和许多未预编译的代码)。 I try to package my game with Flash FDT 5.5 using both methods: 我尝试使用两种方法使用Flash FDT 5.5打包我的游戏:

  • fast - works ok, but the performance is terrible; 快速 -可以,但是性能很差;
  • standard - my compilation finishes with following error: 标准 -我的编译完成并出现以下错误:

Packaging failed! 包装失败! Packaging error message: Picked up JAVA_TOOL_OPTIONS: -Xmx3072M Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.TreeMap.put(Unknown Source) at adobe.abc.Algorithms$SetMap.get(Algorithms.java:225) at adobe.abc.Algorithms.addUses(Algorithms.java:164) at adobe.abc.Algorithms.findUses(Algorithms.java:186) at adobe.abc.GlobalOptimizer.cp(GlobalOptimizer.java:9381) at adobe.abc.GlobalOptimizer.dce(GlobalOptimizer.java:9627) at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4638) at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3514) at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2215) at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:527) at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:337) at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:510) at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:80) Picked up JAVA_TOOL_OPTIONS: -Xmx3072M Compilation failed while executing : 打包错误消息:拾取JAVA_TOOL_OPTIONS:-Xmx3072M线程“主”中的异常java.lang.OutOfMemoryError:adobe.abc.Algorithms $ SetMap.get(算法)处java.util.TreeMap.put(未知源)处的Java堆空间。 java:225)位于adobe.abc.Algorithms.addUses(Algorithms.java:164)位于adobe.abc.Algorithms.findUses(Algorithms.java:186)位于adobe.abc.GlobalOptimizer.cp(GlobalOptimizer.java:9381)位于adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4638)位于adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3514)位于adobe.abc.GlobalOptimizer.dce(GlobalOptimizer.java:9627)网址为adobe.abc.LLVMEmitter的.optimize(GlobalOptimizer.java:2215),网址为com.adobe.air.ipa.AOTCompiler的adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:337)的optimizeABCs(LLVMEmitter.java:527) com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:80)上的convertAbcToLlvmBitcodeImpl(AOTCompiler.java:510)在执行时拾取JAVA_TOOL_OPTIONS:-Xmx3072M失败: ADT Picked up JAVA_TOOL_OPTIONS: -Xmx3072M Picked up JAVA_TOOL_OPTIONS: -Xmx3072M ADT拾取JAVA_TOOL_OPTIONS:-Xmx3072M

I know that this is common issue with Eclipse devlopment. 我知道这是Eclipse开发中的常见问题。 I tried to solve that in standard way -> increase java heap size. 我试图以标准方式解决->增加Java堆大小。 As you can see I've set 3072M which should be sufficient. 如您所见,我已经设置了3072M,应该足够了。

When I try to compile smaller projects it works fine. 当我尝试编译较小的项目时,它可以正常工作。 I've got no idea what to do now :(. Any ideas? 我不知道现在该怎么办:(。有任何想法吗?

After deep investigation I've found a solution. 经过深入调查,我找到了解决方案。 It was NOT due to any enviromnent configuration, but, as @Alan said, Adobe's packager was running into problems. 这不是由于任何环境配置引起的,但是,正如@Alan所说,Adobe的打包程序遇到了问题。 As I suppose, it was meeting problems while 'optimalization' phase. 如我所料,它在“优化”阶段遇到了问题。

Here's a forum topic that was really usefull: http://forums.adobe.com/message/4445973#4445973 这是一个非常有用的论坛主题: http : //forums.adobe.com/message/4445973#4445973

My project was using NAPE physic engine. 我的项目是使用NAPE物理引擎。 As I found there: http://deltaluca.me.uk/forum/index.php/m/2148/0ce4c49cc2c79979154c56737d2978a4/ people meet problems with compilation time. 正如我在那找到的那样: http : //deltaluca.me.uk/forum/index.php/m/2148/0ce4c49cc2c79979154c56737d2978a4/人们在编译时遇到了问题。 In my case the compilation time was infinity ;), what ended with java's out of memory exception. 在我的情况下,编译时间是无穷大;),以Java的内存不足异常结束。 The solution was to use newest NAPE build, which was a little bit optimalized by the author. 解决方案是使用最新的NAPE构建,作者对此进行了一些优化。 This 'small optimalization' made my project working. 这种“小的优化”使我的项目得以开展。

To sum up: if you have similiar problem, just check your code. 总结一下:如果您有类似的问题,只需检查您的代码即可。 Try to find some huge functions/methods, which Adobe's packager finds hard to optimalize. 尝试找到一些巨大的功能/方法,Adobe的打包器很难优化这些功能/方法。

The -Xmx3072M is not a valid Eclipse argument. -Xmx3072M不是有效的Eclipse参数。 Restore your 'eclipse.ini' settings and other Java settings to the defaults and it should work. 将您的“ eclipse.ini”设置和其他Java设置恢复为默认设置,它应该可以工作。 You might be setting it so high that other parts of the JVM run out of memory. 您可能将其设置得太高,以致JVM的其他部分内存不足。

As can been seen by the stack trace, it's not an Eclipse or FDT issue. 从堆栈跟踪可以看出,这不是Eclipse或FDT问题。 Adobe's packager is running into problems. Adobe的打包程序遇到了问题。 If the default still doesn't work, then see about giving Java in general more memory. 如果默认值仍然不起作用,请参见一般为Java提供更多内存。 If that doesn't work, slowly increment Eclipse's memory to see if that works. 如果那不起作用,请慢慢增加Eclipse的内存以查看它是否起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM