Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Size does matter

 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am working on applet that should be very small (100-200k). I could use available libraries but their full size is not acceptable for me.

Is there a way to strip library out of unused classes? Something like linkers do in C++ (static linking)? Something that would track if class is used or not.

Best regards,
Vladas
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Dash-O does what you want (haven't ever used it though). There are probably others as well. You might ask in J2ME forums, since people doing J2ME are the most likely to have worried about reducing library size.
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vladas,

I found Proguard useful for shrinking libraries. More over, the website present an interesting list of alternative tools.

Hope that helps,
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you thought of using URLClassLoader to explicitly load the required classes? This can greatly reduce the initial size of the Applet, but adds to the runtime overhead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic