Tagged: java

Ever hit a “Java heap space” crash while running Flash’s command-line compiler: mxmlc? There are two ways to fix it:

1. Go to your SDK bin directory in a terminal window. (mac with FB: /Applications/Adobe Flex Builder 3/sdks/3.3.0/bin)

Mac / Linux:
2. edit the ‘mxmlc’ file, look for the “VMARGS=…” line, and change the “Xmx384m” to “Xmx684m”.

Windows:
2. edit “jvm.config” and edit the line starting with “java.args=…”, change “Xmx348m” to “Xmx648m”.

3. The “648″ is the maximum heap size (in megabytes) that the JVM will allocate for the compiling process. You can change this to suit your needs.

If you’re not sure how much memory you’ll need, set it to 1024 (a gig) or so, and compile your app with the “-benchmark” arg. That’ll tell you how much memory was used to compile your app, and you can adjust the final size to be somewhere above what it used.