Answer: This answer I found at SUN's site...
The Java 2 release of the Java VM automatically inlines simple methods at
runtime. In an un-optimized Java VM, every time a new method is called, a new
stack frame is created. The creation of a new stack frame requires additional
resources as well as some re-mapping of the stack, the end result is that
creating new stack frames incurs a small overhead.
Synchronized methods and objects have until Java 2 always incurred an
additional performance hit as the mechanism used to implement the locking of
this code used a global monitor registry which was only single threaded in some
areas such as searching for existing monitors. In the Java 2 release, each
thread has a monitor registry and so many of the existing bottlenecks have been
The Java HotSpot VM is Sun Microsystem's next-generation virtual machine
implementation. The Java HotSpot VM adheres to the same specification as the
Java 2 VM, and runs the same byte codes, but it has been re-engineered to
leverage new technologies like adaptive optimization and improved garbage
collection models to dramatically improve the speed of the Java VM.
The Java Hotspot does not include a plug-in JIT compiler but instead compiles
and inline methods that appear it has determined as being the most used in the
application. This means that on the first pass through the Java bytecodes are
interpreted as if you did not have a JIT compiler present. If the code then
appears as being a hotspot in your application the hotspot compiler will
compiler the bytecodes into native code which is then stored in a cache and
inline methods at the same time. See the inlining section for details on the
advantages to inlining code.
Improved Garbage Collection
The garbage collector used in the Java HotSpot VM introduces several
improvements over existing garbage collectors.
The simplest tool used to increase the performance of your application is the
Just-In-Time (JIT) compiler. A JIT is a code generator that converts Java
bytecode into native machine code. Java programs invoked with a JIT generally
run much faster than when the bytecode is executed by the interpreter. The Java
Hotspot VM removes the need for a JIT compiler in most cases however you may
still find the JIT compiler being used in earlier releases.
Some of the other tools available include those that reduce the size of the
generated Java class files. The Java class file contains an area called a
constant pool. The constant pool keeps a list of strings and other information
for the class file in one place for reference. One of the pieces of information
available in the constant pool are the method and field name.
This tip is based on "Chapter 8 Continued: Performance Features and
Tools" of "Advanced Programming for the Java 2 Platform"
book which you read and download
2 comments | | Score: 0