8

What are the differences in starting an application through the plain java command, against directly invoking the JVM through libjvm.so in Linux or jvm.dll in Windows ?

Recently I saw on a forum that starting eclipse using the dll or .so file will give better performance. I would like to get to know how this happens.

Thanks.

Yohan Liyanage
  • 6,840
  • 3
  • 46
  • 63
  • 1
    I don't think there'll be much of a performance difference. Could you link to that claim on the forum? – Joachim Sauer May 26 '11 at 06:10
  • @joachim Sorry, I can't remember the forum post. I saw it sometime back and had it on the back of my mind. But, this StackOverflow entry also states that the Splash Screen comes faster with jvm.dll (see the first answer, notes section). It also states a set of advantages as well. [link](http://stackoverflow.com/questions/316265/tricks-to-speed-up-eclipse). – Yohan Liyanage May 26 '11 at 06:20

2 Answers2

8

Typically folks build against jvm.dll if they want to wrap their own functionality around a Java core, where sometimes it's hard to do things that look "native" from Java. A good example is indeed Eclipse, where they want to pop up a splash screen and do some other actions before starting up. For other products, it's that Java is only a small part of their workload (eg: large C++ app that needs to bridge into Java at some point).

From a performance perspective, it's irrelevant. It's all about how you want the "fit and finish" for things like Eclipse.

Trent Gray-Donald
  • 2,286
  • 14
  • 17
4

The link discusses Eclipse start-up; it is likely that this is faster because, by using the -vm argument to specify the JRE, the Eclipse executable doesn't have to search the system for an appropriate JRE to launch (which would incur disk I/O and possibly involve detecting the version of the JRE). You aren't speeding up Java, you're speeding up the native launcher.

Community
  • 1
  • 1
McDowell
  • 107,573
  • 31
  • 204
  • 267
  • 1
    I agree with you regarding the detection of JRE. I used -vm to point to bin/java instead of jvm.dll or libjvm.so until I came across the link I pointed out. My question was about the difference between these two. Like you said, absent -vm option will be slower. But what I wanted to know is the difference between using -vm to point to java executable and jvm.dll. Thanks ! – Yohan Liyanage May 28 '11 at 04:35