Why is the JVM slow to start?

Jegschemesch picture Jegschemesch · May 9, 2009 · Viewed 28.7k times · Source

What exactly makes the JVM (in particular, Sun's implementation) slow to get running compared to other runtimes like CPython? My impression was that it mainly has to do with a boatload of libraries getting loaded whether they're needed or not, but that seems like something that shouldn't take 10 years to fix.

Come to think of it, how does the JVM start time compare to the CLR on Windows? How about Mono's CLR?

UPDATE: I'm particularly concerned with the use case of small utilities chained together as is common in Unix. Is Java now suitable for this style? Whatever startup overhead Java incurs, does it add up for every Java process, or does the overhead only really manifest for the first process?

Answer

Naaff picture Naaff · May 10, 2009

Here is what Wikipedia has to say on the issue (with some references).

It appears that most of the time is taken just loading data (classes) from disk (i.e. startup time is I/O bound).