aspose file tools*
The moose likes Java in General and the fly likes Can I Reduce the size of JDK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Can I Reduce the size of JDK" Watch "Can I Reduce the size of JDK" New topic
Author

Can I Reduce the size of JDK

Gourav Panda
Greenhorn

Joined: Jun 11, 2008
Posts: 6
Hi,

I used only few API of JDK, and as I am working in embedded Environment I have very less Space in Memory.
Can any one suggest if I can reduce the size of the JDK to an optimum position so that only my Used API will be available.

Please share yours knowledge.

Thanks in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
If embedding, why are you not using the micro-edition? The JVM only loads classes which are required, as far as I can remember, so unused classes are not loaded in the first place.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

How about Java SE for Embedded?

And wasn't this exactly what Java Kernel was meant for as well - a small JRE that downloads what it needs afterwards?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Gourav Panda
Greenhorn

Joined: Jun 11, 2008
Posts: 6
2 good piece of information. Thanks!!
Java Karnel is in JDK 1.6, and Java SE embadded is not free?? I am not sure.

Actually the existing system uses JDK 1.1, Can I apply these concept you explained for JDK 1.0 as well?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

Unfortunately no, since Java Kernel only exists since Java 6, and Java SE for Embedded will anyway no longer be available for such an old JVM.
Gourav Panda
Greenhorn

Joined: Jun 11, 2008
Posts: 6
So, Now comes a compairision, JDK 1.1 VS JDK1.6 with Kernel
Gourav Panda
Greenhorn

Joined: Jun 11, 2008
Posts: 6

Yes Campbell You are correct, Class loaded only on demand!!
So if we reduce the size of JDK or not it does not matter!!

Thanks
Gourav Panda
Greenhorn

Joined: Jun 11, 2008
Posts: 6
But one advantage we will get if we can reduce the size of the JDK is that.
The look up for the class loading will be very fast.

It means, suppose VM want to load Class A, He has to find the class defination from a poll of classes.
So, the searching will be faster, if we reduce the number of class in the poll.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
But one advantage we will get if we can reduce the size of the JDK is that. The look up for the class loading will be very fast.

My gut feeling is that you wouldn't even be able to measure the performance benefit you'd get out of this. (Of course, gut feelings are often wrong when it comes to performance, but I think this one is correct.)


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I Reduce the size of JDK