Want CNET to notify you of price drops and the latest stories?

HotSpot finally makes its mark

Sun Microsystems will release a souped-up, paid-for Java virtual machine called HotSpot at the end of April, but the company won't be alone.

Stephen Shankland principal writer
Stephen Shankland has been a reporter at CNET since 1998 and writes about processors, digital photography, AI, quantum computing, computer science, materials science, supercomputers, drones, browsers, 3D printing, USB, and new computing technology in general. He has a soft spot in his heart for standards groups and I/O interfaces. His first big scoop was about radioactive cat poop.
Expertise processors, semiconductors, web browsers, quantum computing, supercomputers, AI, 3D printing, drones, computer science, physics, programming, materials science, USB, UWB, Android, digital photography, science Credentials
  • I've been covering the technology industry for 24 years and was a science writer for five years before that. I've got deep expertise in microprocessors, digital photography, computer hardware and software, internet standards, web technology, and other dee
Stephen Shankland
6 min read
Sun Microsystems will release a souped-up, paid-for Java virtual machine called HotSpot at the end of April that could expand the Java presence in the corporate environment, but the company won't be alone.

HotSpot is one of several of Sun's efforts to improve the often-sluggish performance of its "write once, run anywhere" Java technology. Although Sun and others give away Java virtual machines for free, Sun will sell HotSpot, targeting it at corporate customers who want to use Java on servers, said Bill Pataky, who's in charge of Java performance at Sun.

"The initial release is aimed at meeting the needs of enterprise server customers," Pataky said.

But other companies aren't sitting idly by as Sun turns the Java crank. For example, TowerJ is targeting its virtual machine at the same server-side Java customers as Sun. Other virtual machine efforts are under way by organizations such as Hewlett-Packard, Mozilla, and Transvirtual.

"This could be the great savior of the Java performance [problem]," said Sally Cusack, an analyst with International Data Corporation. "People aren't using Java to write their mission-critical applications, things that have to be lightning-fast. HotSpot will remove a lot of the red flags people have up."

And in related news today, a federal judge said that a preliminary injunction against Microsoft which required the software maker to pull its Java products into line with Sun standards doesn't apply to virtual machines that have been developed independently from Sun.

Sun has been beta testing the Windows/Intel version of HotSpot and will begin beta testing the Solaris version tomorrow, Pataky said. The version of HotSpot for Sun's Solaris operating system and UltraSparc chip is due at the end of June, he said.

HotSpot, however, has been delayed many times. Initially expected by the end of 1997, it has slipped several times and most recently was expected for the first quarter of 1999.

As a Java program is run, HotSpot "adapts on the fly" to speed up the execution of that program, Pataky said. A Java virtual machine is special software that allows Java programs to be run on a specific computer. Programs written in the original Java language are converted into a "bytecode," a series of numbers that the Java virtual machine translates into the native instructions a computer chip can understand.

Speeding up the virtual machine is just one way of improving Java performance, and Sun is working on other ways too, Pataky said. "We will have further releases coming forth...that will address other performance problems in the future with other Java products," Pataky said, though he declined to give details.

While Java promises companies the ability to write programs that can be reused on different machines, that flexibility has come at the expense of speed. HotSpot could help companies such as financial services or insurance corporations use Java, Cusack said.

Sun is billing HotSpot as bringing to Java the performance of programs written in the C programming language, she said. "If that's true, obviously that will fill a great need in the Java development market. HotSpot opens the opportunity to write some more heavy-duty business applications in Java."

Not the only contender
Although several other companies are involved in virtual machine efforts of their own, those efforts help Sun by lending legitimacy to the Java technology at the same time as they compete with Sun's own virtual machine work.

Sun tacitly began encouraging other virtual machine work in December when it announced changes to its Java licensing rules that will allow "clean room" virtual machines--independently developed clones of Java virtual machines. Although other companies may pursue their own virtual machine work, they still must pay Sun for the use of the Java logo that guarantees the product is compatible with Sun's Java standards.

HP is working on a clean-room virtual machine called "ChaiVM" intended for embedded systems--typically items such as consumer electronics devices in which the nitty-gritty workings of the machines are hidden from users.

Transvirtual is also working on its own virtual machine for embedded systems using PersonalJava, Sun's stripped-down version of Java. Transvirtual's Kaffe is free of Sun code, and is being developed under the open source method that allows all comers to modify the original blueprints. The company also offers a custom version for use by companies unwilling to use publicly available code.

Kaffe works on 30 operating systems and eight different processors, the company says.

TowerJ's Java development software, in contrast to Kaffe and ChaiVM, is aimed more squarely in the server environment of HotSpot. TowerJ comes with the company's DynaFlex virtual machine, which like HotSpot aims to strike the right balance between translating Java programs before they're run and being able to adapt to changing requirements as the Java programs are used.

A more recent entry into the clean-room Java realm is ElectricalFire, released in January by Mozilla, the group that oversees the development of Netscape's Web browser.

ElectricalFire runs on Intel architecture machines using either Linux or Microsoft Windows. The software passes 90 percent of Java compatibility tests on Intel architecture machines, the ElectricalFire Web site says.

Microsoft ships a virtual machine with its Internet Explorer Web browser, although that product isn't a "clean room" version and is entangled in a lawsuit Sun brought against Microsoft.

IBM, a company that has backed much of Sun's efforts to transform Java into a workable product, also is advancing work on speeding up Java with its Jikes Java compiler. The Jikes software, which translates original Java programs into bytecodes, actually works at an earlier stage than a virtual machine in the process of executing Java programs.

In December, IBM opened its Jikes work to the world, making it an open source effort by sharing the original Jikes programming instructions with anyone who wants to contribute to the effort.

How HotSpot works
HotSpot has four main ways to speed Java performance, Pataky said.

First, HotSpot monitors Java programs as they run, remembering what parts of the program get used the most. It then focuses attention on that portion of the program to make it run much faster.

That approach is essentially a hybrid between a compiler, which translates an entire program into a chip's native language before it runs, and an interpreter, which translates each instruction into native code as the program runs. While compilers result in faster performance, they inflict an initial delay while the program compiles, and they can't incorporate new elements of a program as it runs, Pataky said.

HotSpot also has high-speed "garbage collection"--the tidying up of the computer memory used by a program. Automatic garbage collection is one of Java's standard features, but garbage collection often makes programs all but stop periodically when the computer checks its memory to see what parts can be freed up and what parts are still in use.

By contrast, HotSpot employs a "generational" garbage collection technique that takes advantage of the fact that 95 percent of the information a computer needs to remember is very short-lived, Pataky said. When a Java program needs to store information in memory, it gets written to a special area of memory called the "nursery," which is automatically purged often. If the information is still needed, it gets transferred to longer-term storage.

In addition, garbage collection occurs in frequent small steps that are too short to notice instead of all at once. "That limits the pause to something on the order of a few milliseconds, which a human won't notice," Pataky said.

Lastly, HotSpot benefits from Sun work on keeping track of multiple "threads" in a program. Threads are essentially different pieces of a program that can run independently, often on different processors, but at some point one thread may become dependent on another. HotSpot has proprietary technology that allows threads to be synchronized much faster, a boon for Java running on multiprocessor systems, Pataky said.