10

I tend to get these questions asked by a lot by students, or by co-workers looking for a resource, so I wanted a more definite reference for them. Might as well share it with the community.

  • How is the Java Memory Model represented and what are its characteristics?

  • How does Garbage Collection work in general and in the most common JVMs?

  • How do I test and tune my Java applications for performance?

haylem
  • 22,460
  • 3
  • 67
  • 96

2 Answers2

20

Memory Basics

  • What Every Programmer Should Know About Memory - Ulrich Drepper [PDF]

Java Language and Virtual Machine Specifications

  • The Java Virtual Machine Specification [PDF and HTML for Java SE 7]

Java Memory Model

  • Advanced Topics in Programming: The Java Memory Model - Jeremy Manson [video]
  • Collection of Resources on the Java Memory Model - edited and compiled by Bill Pugh (collection)
  • Memory Management in the HotSpot Virtual Machine - Sun Microsystems (2006) [PDF]
  • Fixing the Java Memory Model - Brian Goetz, IBM Java Developer Series () [part 1, part 2]

Java Performance

  • 9 Fallacies of Java Performance - Ben Evans [video + slides]
  • JVM Performance Magic Tricks - Takipi [blog + slides]
  • Java and the Machine - Kirk Pepperdine, Martijn Verburg [video + slides]
  • Performance Testing Java Applications - Martin Thompson [video + slides]
  • Building Memory-Efficient Java Applications: Practices and Challenges - Mitchell, Sevitsky (2009) [PDF]

Advanced Topics and Real-Life Uses Cases

  • Optimizing Google’s Warehouse Scale Computers: The NUMA Experience - University of California & Google [PDF]
  • MegaPipe: A New Programming Interface for Scalable Network I/O [Google Doc]
  • Mythbusting modern hardware to gain "Mechanical Sympathy" - Martin Thompson [PDF] (slides)
  • Caching in: understand, measure and use your CPU Cache more effectively - Richard Warburton [video + slides]
  • A JVM Does That?! - Cliff Click [video]

GC Tuning

  • Hotspot Garbage Collection - Tuning Guide - Martijn Verburg, John Oliver [video, slides pt 1, slides pt 2]
  • Are your GC logs speaking to you, the G1GC edition [slides, video]
  • The Principles of Java Application Performance Tuning [article]
  • Everything I Ever Learned About JVM Performance Tuning @Twitter - Attila Szegedi [video & slides]
  • Visualizing Java GC - Ben Evans [video + slides]

Complementary StackExchange Questions and Answers

And many, many more to come that I need to dig up from my archives or from the inter-tubes.

Community
  • 1
  • 1
haylem
  • 22,460
  • 3
  • 67
  • 96
  • What do you think about "Java Concurrency in Practice" as a guide to writing code that works with the Java memory model? – Patricia Shanahan Jun 09 '13 at 13:55
  • @PatriciaShanahan: I think that in general anything by Brian Goetz is worth knowing about. – haylem Jun 09 '13 at 14:17
  • I feel this is a "link only answer". And not a good one. Do you mean that to understand the JMM and GC we need to first read a 600 pages long pdf and your 30 links? – Matsemann Jun 09 '13 at 19:05
  • @Matsemann: In order: it is. Arguably. No, but that'd help. So, they're helpful, and as mentioned I often get asked this question (note this is my question as well), and while most of these resources can be found with a relatively quick online search, this helps to consolidate some resources and have a single place where to point people (and that is likely to show up rather high in search results), and where it can be edited. Seems good enough for me, and useful for many. I don't deny the link-only aspect and the question really fitting here. Feel free to flag it if you must (or edit). – haylem Jun 09 '13 at 19:21
  • Someone apparently flagged the question. I think your links may be a good resource, but way too much to dig through. If something, a community wiki is a better fit. – Matsemann Jun 11 '13 at 11:38
2

William Pugh, one of the authors of "JSR-133: Java Memory Model and Thread Specification" maintains a webpage about the memory model here:

http://www.cs.umd.edu/~pugh/java/memoryModel/

The complete JSR-133 can be found here:

http://www.cs.umd.edu/~pugh/java/memoryModel/jsr133.pdf

Also relevant is the Java Language Specification, Section 17.4 Memory Model:

http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4

jlordo
  • 37,490
  • 6
  • 58
  • 83