How to make JVM start faster? [duplicate]
Possible Duplicate:
How to speed up Java VM (JVM) startup time?
I am writing a command line utility in Java (or probably in another JVM-based language). The problem is JVM start-up time. JVM starts slower than Python and Ruby, for instance.
How to make JVM stat faster? Can I load JVM "in advance" (in Linux and Windows) somehow so that it should not be loaded every time I run my utility in command line?
For Windows there's the Java Quick Starter which comes with the default installation of the JRE.
http://www.java.com/en/download/help/quickstarter.xml
Nailgun is probably the best solution - it keeps a running JVM instance can then be called by your commands (using a super-lightweight C client).
As an alternative or additional option, you might want to try upgrading to Java 7 if you haven't done so already - there have been quite a lot of startup time enhancements.
To load JVM in advance you can use Drip. It keeps a fresh JVM spun up in reserve with the correct classpath and other JVM options so you can quickly connect and use it when needed, then throw it away. Drip hashes the JVM options and stores information about how to connect to the JVM in a directory with the hash value as its name.
精彩评论