OSX employs its own pre-caching similar to Vista.
Think for second: how many various files need to be read off your hard drive for JVM to get started. There are some tools you can use (depends on your platform) that will help you with coming up with an exact list.
That's A LOT of I/O. No hard drive will give you sub-second time.
If a computer starts an app in, say, about 0.2 seconds every time, it's disingenuous to keep referring to some "2 second lag" since that 2 second lag never really occurs in real use under production conditions. At most, it happens once.
So I just timed hello world (in Java) and it gave me 1.89sec.
That's pretty lame if you ask me. In fact, that's incredibly lame. Imagine if it wasn't just "hello world", but an actual piece of usable code! In fact I can even tell you how long it takes for my Excel parsing tool (Java, command-line based, uses Apache POI) takes to start up on a 100% "cold" machine: about 4 seconds.
I wonder how this simple tool would fare on Linux-based netbooks with total 512MB of RAM and slow CPUs... or something like iPhone.
An extra couple of seconds for booting up an entire framework you haven't used for a few days is nothing to worry about. If you were doing performance intensive work, it'd already be all cached and ready to go.
My machine has lower hardware specs than what the article mentions. This is what i get.
$ java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)
$ uname -a
Linux lneves-t61p 2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008 x86_64 GNU/Linux
$ echo "public class Test{public static void main(String[] args) {System.out.println(\"Hello World\");}}" > Test.java
$ javac Test.java
$ time java Test
Hello World
real 0m0.174s
user 0m0.068s
sys 0m0.016s
It seems that you are wrong.
More likely he had some of JVM in the filesystem cache. Vista/OSX will pre-fetch JVM modules even after you reboot (not sure about Linux) if you run Java software and especially if you have 8GB of RAM...
Do you mean Class Data Sharing?
http://java.sun.com/j2se/1.5.0/docs/guide/vm/class-data-shar...
Lets disable it:
$ time java -Xshare:off Test
Hello World
real 0m0.165s
user 0m0.060s
sys 0m0.040s
Not much of a difference.