Sign in to follow this  
Woody FX

[java] Byte code optimization

Recommended Posts

Hi guys, I have a game done thats working on some platforms. On others it wont run because the bytecode is too large. So i need to re-work the code to reduce the bytecode. I've been reading articles on it but still need more info. Can any of you give me a few more tips?

Share this post


Link to post
Share on other sites
Is it because there is too much code, or too much code+data ?

There are plenty of normal Java size optimisation methods - usually using some obfuscator such as Proguard, but also changing your source to make things more optimal.

Normally cutting size involves reducing the number of classes rather than just reducing the amount of code. Proguard I believe now inlines constants and removes unused classes, so you can put your constants in their own class, and that class will be removed entirely.

You should work out exactly why it doesn't work on specific platforms - does it load, does it run out of memory at runtime, or what?

Then try to address those specifically.

Mark

Share this post


Link to post
Share on other sites
I can get it to load on the Panasonic X60 by removing code. At the moment there is just too much. It recompiles ur code before it installs to the phone. The jar is 77908 before it goes on the phone and 241437 after it has been installed.

So will see if there is any code i can remove.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this