Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 676
Michael Avatar asked Jul 22 '11 20:07

Michael


3 Answers

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

like image 65
Koraktor Avatar answered Oct 24 '22 07:10

Koraktor


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.

like image 45
mikera Avatar answered Oct 24 '22 05:10

mikera


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.

like image 3
om-nom-nom Avatar answered Oct 24 '22 07:10

om-nom-nom