Question: Why Java Hot Spot Compiler has the name - Hot Spot?
Answer: The best answer I actually found in "Technical White Paper
for the Java HotSpot Virtual Machine, v1.4.1" at SUN web site:
"Most attempts to accelerate Java programming language performance have focused
on applying compilation techniques developed for traditional languages.
Just-in-time (JIT) compilers are essentially fast traditional compilers that
translate the Java technology bytecodes into native machine code on the fly. A
JIT running on the end user's machine actually executes the bytecodes and
compiles each method the first time it is executed.
solves the problems of JIT compilation by taking advantage of an interesting
program property. Virtually all programs spend the vast majority of their time
executing a minority of their code. Rather than compiling method by method, just
in time, the Java HotSpot VM immediately runs the program using an interpreter,
and analyzes the code as it runs to detect the critical hot spots in the
program. Then it focuses the attention of a global native-code optimizer on the
hot spots. By avoiding compilation of infrequently executed code (most of the
program), the Java HotSpot compiler can devote more attention to the
performance-critical parts of the program, without necessarily increasing the
overall compilation time. This hot spot monitoring is continued dynamically as
the program runs, so that it literally adapts its performance on the fly to the
A subtle but important
benefit of this approach is that by delaying compilation until after the code
has already been executed for a while (measured in machine time, not user time),
information can be gathered on the way the code is used, and then utilized to
perform more intelligent optimization. As well, the memory footprint is
decreased. In addition to collecting information on hot spots in the program,
other types of information are gathered, such as data on caller-callee
relationships for virtual method invocations. "
Our older tips: March 22, 2001 - October 21, 2002
All published and not published on the site tips read
6 comments | | Score: 0