Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API

Newsletter sign-up

Sign up for our technology specific newsletters.

Enterprise Java
View all newsletters

Email Address:

Can HotSpot jumpstart your Java applications?

What Sun's new Java performance engine can and can't do

May 20, 1999 -- Last month Sun introduced the Java HotSpot Performance Engine, a jumpstart technology for Sun's Java 2 platform that the company says will make conventional just-in-time compilers (JITs) a thing of the past. By using an "adaptive" compiler and new techniques for garbage collection and mutithreading, says Sun, HotSpot can improve application performance by up to 100 percent. Still, experts say those improvements aren't across the board, and HotSpot still lags when it comes to certain applications and hardware configurations. In other words, there are places where HotSpot is hot ... and places where it is not.

"HotSpot is a turbo-charger for the Java 2 platform," said Sun Java Software Division President Alan Baratz, speaking at the product's launch in Paris earlier this month. "It can improve performance of Java applications by two times and is blowing away the competition in speed and scalability benchmarks."

The hot spot

The key to HotSpot, says Sun, is adaptive optimization, which provides a significant performance gain over JVMs that use just-in-time compilers. A JIT translates Java bytecode into machine language on the fly, compiling methods only the first time they're executed and using the resulting machine code in subsequent method calls, rather than reinterpreting the bytecode. This enables a significant performance improvement over earlier Java platforms. But JITs have limitations. For example, complex graphics processing can slow things to a grinding halt.

HotSpot is Sun's solution to the problems experienced by JITs -- at least on the server side. HotSpot can optimize the performance of many server applications, like databases, that execute the same task again and again, using the same objects and calling the same methods. HotSpot identifies these code "hot spots" in a profiling process that begins when the application is launched and continues dynamically to identify the most frequently executed code and concentrate on compiling it. (For a more detailed explanation of this, see the "How compilers and interpreters work" section of Eric Armstrong's March 1998 JavaWorld article on HotSpot.)

Garbage collection and multithreading

In addition to dynamic compilation, HotSpot targets two other key areas instrumental in application performance. Sun estimates that 40 percent of hardware resources used by a typical Java application are devoted to multithreading (whereby multiple I/O data streams are handled simultaneously) and garbage collection (which frees memory space occupied by objects that are unlikely to be used again).

According to Sun, HotSpot improves on conventional garbage collection in several ways:

  • Generational collection: HotSpot's "generational" garbage collection relies on the fact that the large majority of objects in most programs are short-lived, stacking new objects together (an efficient allocation process) in a "nursery," then relocating only the surviving objects once the nursery overflows.

  • Improved 'old-object' collection: When memory becomes sparse, long-lived objects' areas also have to be cleaned up. Live objects in these areas are scanned by the collector and the gaps left by dead objects are compacted (rather than collecting live objects into a new list). This reduces memory fragmentation and increases efficiency by eliminating searches on new lists.

  • Pauseless garbage collection: Application pauses experienced by the user during old-object collection are now spread out over smaller intervals, each no longer than 10 milliseconds. This type of garbage collection attempts to improve user experience in applications where smooth sailing is critical, such as in games.


HotSpot also attempts to eliminate performance bottlenecks caused by multithreading. Sun claims the new technology incorporated into the performance engine can make "synchronization performance so fast that it is not a significant performance issue for the vast majority of real-world programs," according to one of the company's whitepapers.

The speedometers

By some industry measurements, the new features described above seem to work quite well. Preliminary (as yet unapproved by the Standard Performance Evaluation Corp.) results indicate HotSpot has indeed earned Sun bragging rights: it's the top-performing JVM according to the SPECjvm98 benchmark, and its VolanoMark benchmark figures are even higher. (For a detailed explanation of the VolanoMark benchmark, see the March 1999 JavaWorld exclusive coverage of the VolanoMark benchmark report, linked in the Resources section below.)

Sun reported a SPECjvm98 result of 31.1 for HotSpot on Windows NT at 450 MHz -- an impressive 90 percent improvement over the Java 2 SDK running with the Symantec 3.00 JIT compiler on the classic JVM and a 112 percent improvement over JDK 1.1.7 with the same JIT. (See Figure 1 below for a comparison with other JVMs on a Pentium II/350 MHz machine.)

On the JVM front, HotSpot's SPECjvm98 result of 25.3 on a Pentium II also places Sun slightly ahead of IBM, which previously held the lead with a result of 22.6.

Figure 1. SPECjvm98 results for Java HotSpot on Windows NT at 350 MHz

Although HotSpot's preliminary performance on the VolanoMark tests (which measure JVM speeds as a function of the number of concurrent connections) showed JVM speeds still lagging behind some results posted by Big Blue, HotSpot proved to be highly scalable, a drastic improvement over previous HotSpot results for the Windows platform.

Figure 2. VolanoMark results on Windows NT

On SPARC/Solaris, HotSpot showed a stunning capacity for maintaining an almost even throughput value for concurrent connection levels ranging from 200 to 2000. That is, as Figure 3 indicates, HotSpot's ability to handle messages didn't degrade substantially as a function of the number of concurrent chat sessions.

Figure 3. VolanoMark results on Solaris (SPARC Platform Edition)

Sun is calling its VolanoMark results "best-of-industry" despite some individual results that are slower than those for other JVMs. Still, Sun's JVM performance numbers on recent, published VolanoMark tests are a milestone, says Volano LLC founder John Neffenger, considering that until recently, Sun's JDK 1.2 had failed to outperform Microsoft's SDK 3.2 on Windows.

1 | 2 |  Next >
Resources