Question

I want to know the internals of the JVM, how it performs and the details that matters. Can you suggest any resource or best book available for this ??

Was it helpful?

Solution

Most of what I know of the JVM comes from the Sun docs. They have some great whitepapers on the HotSpot VM: http://java.sun.com/javase/technologies/hotspot/index.jsp

You mentioned performance, so maybe you would be interested in the Sun performance docs: http://java.sun.com/docs/performance/

For a more hands on approach, try looking at Kaffe. This will show you what a virtual machine does, but not necessarily how Java code works in Sun's JVM:

Kaffe is a clean room implementation of the Java virtual machine, plus the associated class libraries needed to provide a Java runtime environment.

And the OpenJDK is a great place to learn about how the Java Platform is implemented: http://openjdk.java.net/

OTHER TIPS

Chapters from "Inside the Java 2 Virtual Machine":

http://www.artima.com/insidejvm/ed2/index.html

"Under the Hood" articles by Bill Venners

http://www.artima.com/underthehood/index.html

There's also "Jasmin", an assember for JVM, if you want to get your hands dirty and try low level programming with the JVM.

http://jasmin.sourceforge.net/

The obvious first choice is The Java Virtual Machine Specification. There's also The Wikipedia Page, which links to additional resources.

If your motivation is to find out how to write code that works faster or uses less memory the VM spec won't help too much.

The VM spec isn't designed to give you information about that, it is designed to let VM developer know, roughly, how to implement the VM.

That being said it cannot hur to read it.

The best way to find out about speed/memory issues is at a much higher level, there are any number of books that will help you faster/leaner code.

A profiler is an invaluable tool for testing your code to see what is faster/uses less memory. Profile, see what is slow/uses a lot of memory, change it, profile, see what the changes did.

Here is one good and short explanation of the heap, objects allocation, and garbage collection, Understanding Memory Management. You can explore more starting from there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top