Issue

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.

Solution

Flash CS5 & CS5.5

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

Open the jvm.ini file in your text editor of choice and find the following line:

-Xmx128m

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:

JVM Warning Dialog

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.

 

Flash CS4

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:

HKEY_CURRENT_USER/Software/Adobe/Flash 10/ActionsInspector

(Mac OS) Add the following entry to the <ActionsInspector> element of the Flash CS4 Preferences file located in the /Users/<username>/Library/Preferences folder:

<JVM_Max_Heap_Size>256</JVM_Max_Heap_Size>

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.

Recommendation for CS3 users

When designing a Flash-based application, it is best practice to build it with multiple smaller objects which can be compiled independently.

  1. Create custom components (SWC). Learn more about Creating ActionScript 3 Components.
  2. Use various SWF files which can be accessed dynamically. Learn more on dynamically loading SWF files using the Loader Class (ActionScript 3)

These steps prevent the issue described in this document, and also speed up the compile time of your application.

Additional information

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.

Keywords: kb405257

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy