com.stevebrecher wrote:What you actually want is to pass -server to the JVM. What you think you want is wrong, basically because Java code compiled that way would suck until it is recompiled again, after some profiling. In Java, all method calls are virtual, unlike C++. But >90% of virtual calls always call the same method, because the destination object type is the same. After HotSpot runs the code a bit, these cases are recognized, so when the code is compiled those calls can be made non-virtual or the called method can be inlined (and when guesses are wrong, the code detects this and does a real virtual call - no misbehaviour, it just won't be that fast in that case).
Much more generally, I lack understanding of why comprehensive compilation of large portions of my code is not (as far as I know) an option. In the case of this application and subsequent ones in the endeavor (akin to scientific research) it would be perfectly acceptable to have the jvm spend "a lot" of time at the start of a run doing compilation.