Skip to main content
9999pippoflash
Inspiring
Jun 20, 2012 1:26 PM UTC
Question

Flash Pro CS6 - not enough JVM memory - change 128 to 256, flash doesn't start.

Hi,

working on very large projects, I often get the "flash ran out of memory for the jvm" error.

Restarting flash does the trick for another couple of hours, until I get that error again.

It opens the jvm.ini file to let me increase Xmx memory value.

I change it from -Xmx128m to -Xmx256m

I restart flash, get the error: "Error initializing Java Runtime environment. You may need to reinstall Flash"

I change it back to -Xmx128m, and flash starts again.

But obviously, I again get the "not enough memory" error.

Am I doing something wrong?

Also,

after installing Flash Pro CS6, previously installed Flash Pro CS5.5 does not start, gives me the JVM initialization error all the time, regardless of which Xmx value I put for CS5.5

This topic is closed to new replies. Start a new post to keep the conversation going.

17 replies

Participant
Oct 1, 2019 1:48 AM UTC

How to fix it?

Translate
JopWheelz
Participant
Nov 3, 2014 3:53 PM UTC

I was having these issues as well all of a sudden in Flash CC 2014. With my AIR-iOS project using Starling. My jvm.ini file had 256 in it by default to I changed that to 512 which caused all sorts of random errors in my Assets class where I embed all my assets using the [Embed tag.

So I uninstalled Flash and reinstalled it again. Opened my FLA and Flash told me I should use AIR 14.0 for iOS as my previous Target version was too old. Right now I can compile my FLA properly again without the Java error. So... not 100% if it was the re-install or switching to AIR 14.0 for iOS as Target but I have been compiling the FLA 7 times now without restarting Flash. Fingers crossed

Translate
JopWheelz
Participant
Nov 4, 2014 6:34 AM UTC

back to square one again. The error message just popped up. So annoying.

update:

I removed some of the images I embed using the '[Embed tag'. And now it publishes again without the error. Weird because the published swf is only 1.8MB. Nothing crazy. So the problem seems related to embedding images using the [Embed tag...


update 2 / FIX:

Instead of using the embed tag to embed images I now have an 'assets' folder that I add to the AIR project (publish settings) that contains my images. Then I load the various images using the Loader. After an image is loaded I convert it to a Texture to use in Starling like so:


var bitmap:Bitmap = new Bitmap(new BitmapData(currentBigTextureLoader.width, currentBigTextureLoader.height, true, 0x00000000));

bitmap.bitmapData.draw(currentBigTextureLoader);

bigTextures[aBigTexturesToLoad[nCurrentBigTextureToLoad]] = Texture.fromBitmap(bitmap);

You can then use these Textures to display an image in Starling like so:

var base:Image = new Image(bigTextures["CollectionBase"]);

Bit of a workaround but al least I don't get the Java Error anymore

Translate
Inspiring
Nov 16, 2012 4:17 AM UTC

I just installed CS6 and had the same problem.  My solution is quite simple.  After I encoutered the problem, I re-installed java as administrator by clicking the installer.  But I doubt that is necessary. 

Then I ran Flash CS6 as the administrator by right clicking the shortcut.  That worked. 

So I have set up the shortcut to run as the administrator.

Translate
Participant
Jun 21, 2012 3:30 PM UTC

I have a similar but slightly different problem.

I have a large flash project which compiles ok in Flash CS5.5 as long as I change the -Xmx128m to -Xmx300m

I I try and compile it in Flash CS6 then any value for Xmx over 178 causes the "Error initializing Java Runtime environment. You may need to reinstall Flash". The project won't compile.

I'm running Windows XP with 4GB of memory.

My guess is that Flash has a fixed amount of memory that it is allowed to use for the program, your fla file and the compiling process. This amount is fixed regardless of the computer's memory.

CS6 is a larger program than CS5.5 so leaves less for the the fla file and compiler. Hence, large files which compiled on CS5.5 won't compile on CS6

Any solutions would be very wellcome.

Translate
Participating Frequently
Jun 21, 2012 3:34 PM UTC

Hi SeaBream - I got that error as well but only if I bump up the -Xmx128m too much. For me reducing it back to someting  < 300 made it work again.

I would appreciate if someone from Adobe could comment on this though because at the moment - I've got expensive subscription to Creative Cloud and I can't use it because this issue basically stops me developing anything!

Translate
Participating Frequently
Jun 21, 2012 4:21 PM UTC

I can't see how this makes ANY sence but I just moved files associated with my test project away from my [USER] home directory to a different folder and the error disappeared. I've been messing around with this for a few hours but I don't believe I changed anything which could have affected it.

Really, Really weird but happy that it works!

Translate
Participating Frequently
Jun 21, 2012 2:38 PM UTC

I have exactly the same problem but my flash project is absolutely tiny. (15 lines of AS3 code!) I can compile once - then have to start flash again to compile again. Totally unworkable.

Translate
Participant
Aug 2, 2012 5:47 PM UTC

I am seeing the same problem with any size file. A completely empty AS3 document will compile and run, but if I add even one space to the timeline actionscript I get the JVM out of memory error!

Translate
Mohanaraj
Adobe Employee
Adobe Employee
Aug 3, 2012 10:10 AM UTC

Hi Joe/MochiSteve,

Could you please share a file or two with which you are facing this issiue. Would like to take a look at it to get more details.

MochiSteve: could you please share your machine config details?

Thanks!

Mohan

Translate