Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : J words : JVM.
The machine code for an ideal Java CPU. Sun is working on silicon CPU for this set of op-codes. The multi-platform universal *.class files are the machine code for such an ideal machine due out in 1997. Mitsubishi has also announced one. JVMs can be interpreters, JITS, Hotspots or native code. See compiler for details. It is possible to write code for the JVM more or less directly with a JVM assembler. JVM also refers to the platform-specific program that can interpret JVM byte codes and execute them.
I know of only four books that cover the JVM and the binary codes, the classfile format etc.
![]() | Programming For The Java Virtual Machine | ||||||
| 0-201-30972-6 | |||||||
| Joshua Engel | |||||||
| From the reviews it looks like it too gets hung up on a propietary assembler called Oolong. He does provide a code-generating class and spends one chapter on using it. I think the book would have been more useful if all the examples were in code-generator code, rather than an obscure dialect of assembler. | |||||||
| |||||||
![]() | The Java Virtual Machine Specification | ||||||
| 0-201-43294-3 | |||||||
| Tim Lindholm and Frank Yellin | |||||||
| Read online. | |||||||
| |||||||
![]() | Inside The Java Virtual Machine | ||||||
| 0-07-135093-4 | |||||||
| Bill Venners | |||||||
| Covers Java 2 JVM internals. ISBN of first edition was 0-07-913248-0. See the blurb. | |||||||
| |||||||
There are about 60 compilers that convert languages other than Java to JVM byte codes. They include: Tcl, BASIC, Scheme, Eiffel, COBOL, Ada, Python and Forth, as well as others less well known such as Pizza and Fiji.
The standard JVM can only run one progam at a time. However Echidna lets you run many. It is a set of pure Java classes that will work with any JVM.
Roughly speaking, here is how a JVM works: the JVM has a heap that is managed by an automatic a garbage collector. On it are class objects, hunks of code (either in byte code format or natively compiled), ordinary objects and thread stacks. Each thread has its own 32-bit stack, typically about 1 MB of virtual RAM (quite a bit more overhead that most people would expect from a thread). The stack is broken into frames, once for each level of procedure call. A method can only "see" its frame, not those of its calling ancestors. The frame contains the parms passed to the method. Local references, local primitives and workspace are also stored on the stack.
The heap is typically broken into subheaps with various categories of objects collected together by size, age, class etc. For example, stack frames might typically be collected together since they are all the same length, and all large. This makes finding a suitable sized free slot faster, and avoids fragmentation. together. It also allows garbage collection to proceed incrementally on just one subheap at a time, rather than stopping everything to collect the entire heap.
If you want to peek under the covers and see in detail how the JVM works, you are out of luck. Sun does not disclose that. However. there are some other JVM implementations. The Kaffe VM is open source. There is Japhar, LGPLd, and Electrical Fire, which is a part of Mozilla.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 2544. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/jvm.html | J:\mindprod\jgloss\jvm.html | |||