Adobe Flash iOS packager throws java.lang.OutOfMemoryError when packaging large projects
Asked Answered
C

3

7

I've been porting a Flex 4 codebase to iOS using the adobe packager, but have run into a snag when trying to package our whole codebase. The packager runs for a while and then throws an OutOfMemoryError - even if I increase the java heap size to 4GB.

No single piece of code seems to be causing the problem, as it compiles successfully if I cut out large chunks of code, and I can change which chunks I'm omitting. It might be related to the size of the code itself.

I've logged a very detailed bug report with adobe here: http://bugs.adobe.com/jira/browse/FB-32192 . It includes an AIRI file that you can package to reproduce the issue, a ruby script that generates actionscript code to generate that AIRI file, and a summary of all of the things I tried before logging the bug.

Has anyone else tried compiling large projects with the iOS packager? Are there any known workarounds?

Constanta answered 20/7, 2011 at 16:12 Comment(6)
Are you using Flex 4.5.1? If not, I suggest upgrading your SDK and tooling and seeing if you still have problems. Flex 4 (and it's related AIR Version--are not optimized for iOS deployment.Cushman
Yup, everything is on flex 4.5.1 and using AIR 2.7.Constanta
The question said Flex 4, so I wanted to be sure. Unfortunately, I can't help further. Hopefully someone else can. +1 from me.Cushman
Jesus, how much code are you trying to compile? The end application size will be massive! Can you show how you're trying to 'package our whole codebase'?Herder
It's really not that much code. Our entire SWF is only 3.4 megabytes, and that includes some visual assets. By "whole codebase" I really just mean the entire project, without anything commented-out. Our code has ~3000 classes. For comparison, a nearly-blank flex mobile project has over 600.Constanta
I had this problem with 4.5. It was a known issue but it was solved in 4.6. Can't you upgrade to it?Federative
O
1

try to use x64 Java runtimes. It solved the similar issue for me - project packaged successfully using x64 Java runtimes only, x86 Java process couldn't allocate as much RAM as it needed to package my project even with heap sizes increased.

Oscitancy answered 26/4, 2012 at 14:58 Comment(0)
B
0

There is nothing you can do about this, it is a known problem the adobe packager. The only thing I would do is to try to set the min-heap size very high or perhaps something crazy like running it with jdb (even if there are no debug symbols...).

Below answered 3/8, 2011 at 3:58 Comment(0)
A
0

Try using Ant to control the process, described here, and then adjust the java settings in ant as follows:

fork="true"
maxmemory="256m"
Applied answered 8/9, 2011 at 21:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.