Large Adobe Flash CS3, CS4, CS5 and CS5.5 applications don't compile. A blank Test Movie window appears or the SWF file is blank.
The same property as in the CS4 solution below can be configured in the jvm.ini file in the location below:
<InstallLocation>/Common/First Run/ActionScript 3.0/jvm.ini
Change the 128 to the suggested amount (256 or more depending on the application). Restart Flash Professional to give the JVM the new starting amount of memory.
Note: A new warning dialog has been added to CS5.5 for users that encounter this issue. Below is what the warning dialog will look like:
Clicking the OK button will open the jvm.ini file mentioned above in the Flash CS5.5 code editor and allow the user to change the -Xmx128m value. Note: You must quit and restart Flash Professional for the changes to take effect.
Warning! By following the directions below, you modify the Windows System Registry. A mistake could cause serious system damage, which could require you to reinstall your operating system.
If you are not comfortable editing the registry, get assistance from your system administrator or another IT professional. If you choose to proceed, first back up your entire hard drive, and create a Windows System Restore Point.
An edit to the "JVM Max Heap Size" property in the ActionsInspector category can resolve this issue.
(Windows) Add a DWORD Value named "JVM Max Heap Size" with a value of "256" in the following location in the registry:
(Mac OS) Add the following entry to the <ActionsInspector> element of the Flash CS4 Preferences file located in the /Users/<username>/Library/Preferences folder:
The number read in is interpreted as megabytes. The max heap size defaults to 128 megs. Adobe suggests an increase to 256 megs to resolve this issue. If this increase in memory does not resolve the issue, continue to increase by 256 megs.
Note: It is best practice to not increase this number by too much. If you increase it too much, Flash Professional can use up all available memory on the user's computer. Adobe recommends that you only raise the heap size enough to fix the problem at hand.
When designing a Flash-based application, it is best practice to build it with multiple smaller objects which can be compiled independently.
These steps prevent the issue described in this document, and also speed up the compile time of your application.
There is no unique number that qualifies as too much. This issue typically occurs in Flash-based applications made up of thousands of lines of code, numerous large objects, or a great number of small classes.
This issue occurs when the JVM compiler max heap size isn't set high enough. Flash doesn't have enough memory to complete certain compile operations. This issue can be solved in CS4 by editing a registry entry on Windows or by editing a preference file on a Macintosh. CS5 users can resolve this issue by editing the jvm.ini file as shown in the solution below.