The title captures my question fairly well. I'm wondering if there is a good resource or leaping-off point for questions about how a JVM (not just HotSpot, but that's obviously the place to start) implements or handles a specific functionality? I'm not looking for the stuff that's in the JLS or JVM Spec -- I know to go there first.
For example: When trying to understand performance issues, we often get into conversations not about what the spec says, but what contemporary best-practices look like in practical implementations. For example, there is some urban mythology that says "final classes perform better in Java because the JVM can inline or otherwise optimize such things." Is there a general resource we can turn to in order to evaluate these claims that float around?
I offer an answer to my own question, with HotSpot-specific references. What about other vendors' offerings? Specifics to small JVMs? Multi-core specifics? Platforms specifics, if they make a difference? Specifics to other JVM languages?
Just to head off a couple of potential complaints: 1) This isn't about looking for premature optimizations (and in fact, better understanding of the platform should dissuade a better educated developer!); and 2) I know Java programmers are supposed to focus on nice, portable, run-anywhere code, but for many of us the platform specifics end up mattering!
This was inspired by some helpful comments on a specific question by Thorbjørn Ravn Andersen. I'm happy to collect some other more helpful examples beyond the one I cite above, to motivate why folks might want these kinds of resources.
Some interesting related questions on SO: Tail-call optimization in JVM, Killer JVM features, optimizations that are going to be useless tomorrow, Differences between JVM implementations.
Edited to Add: I'll award the answer either to the best individual reference mentioned, or to someone who provides a pointer to a website (perhaps built in response to this question) that best concentrates/catalogs JVM implementation wisdom and the practical consequences on client languages and developers.
- The OpenJDK "JVM Internals" wiki is a place to start for HotSpot
- Oracle's Java SE 6 Performance White Paper and its predecessors give a lot of insight, though isn't organized for my question per se
- On synchronization for HotSpot, see my answer here.
Some time ago I put together a short summary about what advanced programmer should know about jvm internals and help him to understand concurrency, gc, jit etc. better. It is a concentrated summary based on specification and OpenJDK.
来源:https://stackoverflow.com/questions/3963643/canonical-reference-on-jvm-internals-for-programmer-developers