Skip navigation
Currently Being Moderated

How do I stop "Exception in thread "main" heap space

Dec 10, 2012 6:12 AM

Tags: #pro #iphone #ios #ipad #action_script_3 #flash_professional #cs6 #java_runtime_environment

I'm trying to rebuild my iPhone app, with hires graphics etc, using CS6 Flash Pro. However, I get this now,

Exception in thread "main" heap space .....  followed by a lot of location information related to the error.


Now, how do I increase the java memory allowances if that's the problem. I've already upp the jvm.ini file from 128 to 512. No difference.


I'm based on

Win8, 8GB RAM, x64


I'm obviously asking it to load a lot of resources - but hey, Flahs should be able to handle it right?


thanks if anyone can help

  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 10, 2012 6:42 AM   in reply to rachalmers
    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 6:56 AM   in reply to rachalmers

    Where is the location of that file and can you paste the exact lines you used for Xmx?


    For example (I'm using CS5.5) in:

    C:\Users\USERNAME\AppData\Local\Adobe\Flash CS5.5\en_US\Configuration\ActionScript 3.0\jvm.ini


    I set:





    Flash starts just fine. I can reliably go up to Xmx640m but after that I sometimes see an issue starting Java.

    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 8:35 AM   in reply to rachalmers

    This is something unrelated (most likely) but 512 and 1024 Icon files should be left in the root build of your folder called "iTunesArtwork" and "iTunesArtwork@2x" respectively with them added in the XML:


          ...smaller icons...





    They must be included in packaged files of course. Also you must now supply that 1024 PNG while submitting the app.


    Aside that you can't use crazy numbers that exeed both Java nor the applications heap limitations. I've never needed to exceed mine beyond 512m. What kind of app file size are we talking about here?

    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 9:20 AM   in reply to rachalmers

    Note in my example I left the .PNG off the name of the iTunesArtwork examples. You should remove that on your filename as well as in the XML. CS6 may do this automatically for you but adt or Flash Builder won't so it's good to get into the practice of doing it correctly.


    Glad you got it worked out. Apple loves to change things up . If you're all set please mark the thread answered so we can filter unanswered. Good luck!

    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 9:30 AM   in reply to rachalmers

    I include them in my base dir as I mentioned. All my other icons are in a subfolder.


    You still have .png on the file extension for iTunesArtwork@2x, remove that and make sure the filename itself on the file system doesn't have .png. That might be your snag if your XML file is looking for it without the .png extension (the correct way).


    During packaging check the files you're including and you should see those 2 files in your root being added.

    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 10:09 AM   in reply to rachalmers

    Apple at it again, inventing new icons and obscure ways to add them . I think they do it just to torture Adobe with meaningless updates.


    Your XML file is generated every time you open publish properties in Flash Pro, which is mildly irritating. I got used to copying the XML file, using publish just to change something like add or remove included files or change my credentials or IPA output folder. Then I'd close it, you see it re-writes (pointlessly) the whole XML file. I'd then simply delete it and replace it with my previous XML file. I always found managing the settings in that file myself while avoiding the auto-generated Flash publish settings XML solved a lot of problems.


    All that matters is it works for you. If you're all set please mark the thread answered so we can filter unanswered questions. Good luck!

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points