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:

The K virtual machine and the Palm V, Part 1

Java has a reputation for being big -- really big -- especially in its memory consumption, but as the new KVM reminds us, it didn't start out that way

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Java started life as an operating system environment for a handheld device called the *7 ("star seven"). The *7 had only a couple of megabytes of flash memory into which all of Java and its classes had to fit. Later, when Java was targeted at set-top boxes and Web browsers, the constraints on Java's size were relaxed. When Java was released to the world in March 1995, it took up several megabytes of disk space -- even more when stored in an inefficient filesystem like Microsoft's FAT16. Today, the CLASSES.ZIP file for Java 1.1 is nearly 9 MB, and is bigger still for the Java 2 Platform, Standard Edition. How can you go from that multimegabyte monster to something small? How can you put the genie back into the bottle?

What exactly do you mean by 'Java?'

The path to recapturing the genie begins with the question posed in the heading above. The question of what exactly is meant by the word Java has been the subject of several recent court cases, and the ambiguity is not surprising. There has always been a lot of confusion around the concept of Java -- even within Sun itself, in the early days. Does the name refer to the language? Or the interpreter and the language? What about the classes that were used? If you want to discuss the size of Java, you must first have a clear definition of what exactly Java is. This question took on huge political ramifications when Sun began pushing its "write once, run anywhere" mantra -- for, in order for this statement to be true, the definition of Java had to include things, such as user interface classes, that one might not otherwise expect to be included.

A pro forma definition of Java was presented in the Java Language Specification by Guy Steele and Bill Joy. That specification included, by reference, the core set of Java classes and user interface classes that formed the basis of the Java Developer Kit (JDK) distribution. Using this definition and the JDK 1.1.8, we can arrive at a size estimate for Java that is something in the neighborhood of 10 MB of disk space! To move from there to the realm of the small -- and for PDAs and pagers you'll need something much smaller than 1 MB -- you either need better than 10:1 compression, or you need to change the question.

Making Java smaller: The Java Card and Embedded Java

Prior to the introduction of the K virtual machine (KVM), Sun had made a couple of attempts to make Java smaller, in the form of the Java Card and Embedded Java. These represent two interesting approaches to the problem of reducing Java's size, and at least one of them was fairly successful at solving the problem within its design space.

Smart cards are devices with a very small memory size, so to run Java, they have to have a very small version of the language. The size reduction in Java Card was accomplished using two techniques: the first was to limit the number of classes required to be considered compliant, (for example, there are no Windows system classes); and the second was to implement the bulk of the Java Card specification in a single kernel binary with a wrapper of Java around it.

  • 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