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?

paleozogt
  • 6,393
  • 11
  • 51
  • 94
karl
  • 71
  • 1
  • 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. – JeffryHouser Jul 20 '11 at 17:27
  • Yup, everything is on flex 4.5.1 and using AIR 2.7. – karl Jul 20 '11 at 17:30
  • The question said Flex 4, so I wanted to be sure. Unfortunately, I can't help further. Hopefully someone else can. +1 from me. – JeffryHouser Jul 20 '11 at 17:44
  • 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'? – J_A_X Jul 20 '11 at 18:27
  • 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. – karl Jul 20 '11 at 19:15
  • 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? – Eduardo Apr 26 '12 at 17:10

3 Answers3

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.

focus
  • 31
  • 5
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...).

Mikhail
  • 7,749
  • 11
  • 62
  • 136
0

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

fork="true"
maxmemory="256m"
davidethell
  • 11,708
  • 6
  • 43
  • 63