What is the difference between jvm and kvm




















In other words, typical embedded devices with limited resources. Figure 2 shows how the libraries of the two J2ME configurations are related to the libraries of the other Java editions. For maximum portability of applications, the designers of an embedded system that would run Java applications should select either CDC or CLDC as their library configuration. Building on the configuration's library framework are one or more optional profiles.

These are extensions of the standard libraries specific to a particular class of embedded system. This allows a more reasonable, trade-off-centered approach toward portability. It is certainly much more likely that the owner of a cell phone from one manufacturer would want to run a Java utility, application, or game written for another brand of cell phone, than that the owner of a logic analyzer would want to run Java code originally written for use on a microwave oven.

To gain such portability, cell phone manufacturers might be willing to add a few libraries and a corresponding amount of ROM that microwave oven manufacturers would not.

J2ME's configurations and profiles are defined by technical partnerships involving Sun and its customers, under the guidelines of the Java Community Process. KVM was first envisioned as a Java virtual machine for Palm handhelds, and it is in that environment that embedded developers can best exeriment with and appreciate it and the J2ME libraries. The code and tools you'll find there help Palm OS users run Java applications that are available for other MIDP-compliant devices, such as mobile phones and pagers.

This code has been designed for easy portability. And all of the CLDC library code is written in Java and supplied in bytecode form, which KVM can execute once you get it up and running on your target platform.

It is done this way to make it easy to target any or bit processor for which a C cross compiler exists. Other than implementing a couple of platform-specific functions in C, there's not much to the porting process.

But wait! How can KVM execute platform-independent Java bytecodes on your specific processor without some platform-specific assembly code? Your compiler does the rest for them automatically-by turning each C snippet into one or more native opcodes.

This may not produce the most efficient translation from each bytecode to the native opcode s of your specific processor, but it does make the KVM code extremely portable. The only platform-dependent functions you'll write to port KVM are concerned with allocating big chunks of memory for heap expansion, deallocating the same, returning the current system time, and handling user interface issues.

There are also some optional hooks for doing platform-specific stuff during VM startup and exit. Makefiles and platform-dependent code for each of these platforms are provided for you. I began with the code for KVM 1. The size of the KVM executable is heavily influenced by the Java language features selected when it is compiled. Configuration options include:. Somewhat to my surprise, these default files together took up almost KB of memory on my Palm V.

But that seems to be the maximum, with all options and CLDC libraries included. The MIDP libraries are not included in this figure. Typical Java applications for the Palm-like games and calculators-load more slowly one to two seconds but otherwise execute as responsively as native Palm apps. It appears the KVM restarts each time a new application is run. Some initial concerns about garbage collection were addressed in release 1. And, though the new collector is not deterministic, it is far more responsive and respectable than its predecessor.

One remaining complaint concerns the threading model, which has yet to be improved in any update. Under KVM, each Java thread executes a fixed number of bytecodes before being preempted by the scheduler. This overly simplistic round-robin approach needs to be replaced by a priority-based preemptive scheduler to make KVM more than just a platform for experimentation. Additionally, the virtual machine enhancements suggested in the Real-Time Specification for Java would greatly enhance the value of KVM to real-time developers.

Some of the proposals address determinism, others garbage collection and thread scheduling. Perhaps now that KVM's source code is out there, a helpful individual or group will come along and make these changes for the benefit of all. There are still some issues of efficiency and determinism to deal with, but those are not of universal concern.

By putting the trade-offs of size vs. And J2ME's configurations and profiles provide a flexible roadmap for achieving a desired level of portability at a more reasonable cost. The Java Virtual Machine Specification. New York: Addison-Wesley, They can even make changes to that code that suit their system's needs.

However, before they start shipping a product that includes that software, they need to enter into a licensing agreement. This article was published in June by Embedded Systems Programming magazine. If you wish to cite the article in your own work, you may find the following MLA-style information helpful:. Source Code Review Services. Reverse Engineering Services. Barr Group's logo is a U. Skip to main content. Search form Search. It is developed for use with J2ME. How are we doing? Please help us improve Stack Overflow.

Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 11 years, 6 months ago. Active 11 years, 6 months ago. Viewed 1k times.

Improve this question. The set of. Similarities: All the virtual machines primary source is developed in java. Dissimilarities: Set of libraries have changed. Memory allocation is different. No comments:. Newer Post Older Post Home. Subscribe to: Post Comments Atom.



0コメント

  • 1000 / 1000