Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can, or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing heavily in Java's future as a platform for platforms

Also see:

Discuss: Tim Bray on 'What Sun Should Do'

Featured Whitepapers
Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Can HotSpot jumpstart your Java applications?

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

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

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.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources