Vote on (option to pre-load JVM)
Greetings.
I wish to draw your attention to an RFE (request for enhancement) that could use your vote.
The RFE is asking for the jre to have the option of preloading the JVM at startup. Once loaded, the new 'tray icon" service would be responsible for keeping the rt.jar library loaded (which basically means waking up every once in a while and executing something inside of rt.jar).
This would be an option that is turned OFF by DEFAULT. The user would have to go into the java control panel to turn it on.
Why do this you ask? Well I did some extensive testing on cold start times between 1.4, 1.5 and 1.6. See the link at the bottom. The upshot was, that a huge amount of time is spent loading the jvm and rt.jar. All of the lazy loading technologies really didn't help. So, for those willing to have YATI (yet another tray icon), please give the option of preloading the jvm. You see it with other products, like QuickTime...
Please vote and leave your feeback at:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6346341
The orginal thread that started it all (lots of benchmark data):
http://forum.java.sun.com/thread.jspa?messageID=3962327
Personally I think the idea of pre-loading the jvm like a tray icon would be a bad thing overall. I see your point however:
1. First + Foremost java takes up too much memory. Just running simple hello world apps now take tens of megabytes to run simply because of the (bloated) size of the JRE. It's not like quicktime which can load a stub in < 1 Mb this is a bear
2. What happens when someone calls System.exit()? I'm guessing your answer is "well the JVM restarts" but what about all the other apps running on that JVM? It would kill them too. Beyond that one java app(let) could start interfering with another java app taking memory making environment changes etc.
3. Possibly my biggest best reason is that almost all real commercial java applications need more memory than the default allocated by just calling 'java ...' how would we know how much to allocate when starting the jvm? Or we could allocate at runtime and fragment memory all to ****. Anyway you get the idea
You have good points. Perhaps it is my ignorance of windows internals - but let me take a stab at this and perhaps clear a couple of things up (for me at least).
1) I think you are correct that the JRE footprint size is an issue especially when you compare it to something like quicktime. In defense of the RFE, it is precisely for that reason that I recommend that the option be off by default.
2 and 3) The tray icon isn't the single JVM of the system. It is an instance of the JVM that is providing a service. Let me take a stab at how I would implement it.
The java tray icon becomes a loading service that pre-caches the jar files in memory and cycles through them (to keep them in memory). When a local JVM instance is invoked, be it a browser or local application that instance of the jvm would query for the existance of the java tray service and if present, use it to load rt.jar etc. from its memory cache.
Hope that makes sense.
-Dennis
> Personally I think the idea of pre-loading the jvm
> like a tray icon would be a bad thing overall. I see
> your point however:
>
> 1. First + Foremost java takes up too much memory.
> Just running simple hello world apps now take tens of
> megabytes to run simply because of the (bloated) size
> of the JRE. It's not like quicktime which can load a
> stub in < 1 Mb this is a bear
>
> 2. What happens when someone calls System.exit()? I'm
> guessing your answer is "well the JVM restarts" but
> what about all the other apps running on that JVM? It
> would kill them too. Beyond that one java app(let)
> could start interfering with another java app taking
> memory making environment changes etc.
>
> 3. Possibly my biggest best reason is that almost all
> real commercial java applications need more memory
> than the default allocated by just calling 'java ...'
> how would we know how much to allocate when starting
> the jvm? Or we could allocate at runtime and fragment
> memory all to ****. Anyway you get the idea
*bump*
Mustang
Cold Start Warm Start
JVM LoadedApplet PaintedJVM LoadedApplet Painted
Run 12645919
Run 22748918
Run 32850817
1.5.05
Cold Start Warm Start
JVM LoadedApplet PaintedJVM LoadedApplet Painted
Run 1213337.5
Run 2223537.5
Run 3223537
1.4.2_010
Cold Start Warm Start
JVM LoadedApplet PaintedJVM LoadedApplet Painted
Run 117n/a3n/a
Run 218n/a3n/a
Note:
We are serializing POJOs back to the client and that is why the applet failed to load with 1.4
JVM Loaded = when the custom logo graphic appears.
All times are in seconds.
Numbers posted are total elapsed time.