Jump to content
  • Advertisement
Sign in to follow this  
Woody FX

[java] Byte code optimization

This topic is 4878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Yes J2ME. I think it will take to take out vast chucks of code as my efforts so far havent yielded any joy on the phone.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!