WTF? – 5005: Unknown error optimizing byte code.
I recently came across a problem I hadn’t had before – 5005: Unknown error optimizing byte code.
After a little googling I found that this occurs when you are compiling a large project (e.g a lot of code) from the Flash IDE. Now I don’t tend to compile these sort of projects from the Flash IDE (usually I’d compile it straight from FDT or FlashBuilder), but for various reasons this project required it.
So, after reading this blog post, I found it was simply a matter of increasing the memory allocated to the Flash IDE.
If you’re on a mac, head over to /Users/YOUR_USER_NAME/Library/Application Support/Adobe/Flash CS5/YOUR_LANGUAGE/Configuration/ActionScript 3.0/ and open jvm.ini in your favourite text editor. Then increase -Xmx128m to -Xmx256m (or whatever amount you require), save the file, and you should be good to go.
Make sure you quit Flash before you do this – your changes should come into effect once you relaunch the Flash IDE.

November 10, 2010
Ha ha ha!
Us PC boys don’t have these issues
Come over to the dark side Jass…….
November 10, 2010
@Kyle – Ha, I’m fine where I am mate!
I’ve actually heard of a few PC users who have had this issue too – it’s just stored somewhere else: System Hard Disk\Users\\AppData\Local\Adobe\Flash CS5\\Configuration\ActionScript 3.0\jvm.ini
January 4, 2011
Awesome! Best response I could find on the web after all the Google searches.
May 9, 2011
Thanks for the fix, i was stuck trying to figure
Out this error for 3 hours. Thanks Jass for your
Post it saved me hours of time.
August 9, 2011
Thanks a lot for posting this fix!
January 20, 2012
This is the first post I found, after searching for three days, that offered a way to resolve this on the Mac. I couldn’t find the file in my Library but I did a spotlight search for “jvm.ini” and found it in “Applications/CS5/Adobe Flash CS5/Common/First Run/Actionscript 3.0/”
Thanks for the clue!