Performance Tuning at Twitter


Posted on 29 May 2012 15:26

Have you ever wondered what kind of JVM performance tuning is necessary on a site for millions of users?

If so, in this presentation Attila Szegedi a former Twitter engineer, talks about what he learned about performance tuning at Twitter.

What I find most valuable in this presentation is the quality of the technical content. This view of how the JVM memory works from the inside help us to understand what we can control and configure. As usual when we are talking about JVM performance, Garbage Collection is the central subject of the presentation, Attila talks a lot about 64 bits JVMs and its differences with the 32 bits ones. He also has a method to select the more adequate sizes for the Heap sections of a HotSpot Virtual Machine, he does it (or explains it) by activating garbage collection logs and analyze its operation.

An example of what you will find in this presentation are some tips about ideal young memory (aka Eden) operation:

  • Should be big enough to hold more than one set of all concurrent request-response cycle objects.
  • Each survivor spaces should be big enough to hold active request objects + tenuring ones.
  • A tenuring threshold such that long-lived objects tenure fast.

There are other interesting tips:

  • A JVM is normally a two machine word, it means: 16 bytes on a 64 bits JVM.
  • A new java.lang.Object() takes 16 bytes.
  • A new byte[0] takes 24 bytes.

Certainly, in most of the real life projects you won't need to go deep into the dirty details of native object sizes, but is good to know what happens at very low levels of the JVM, also, this kind of analysis can be applied to understand and tune some specific application.

Currently Attila works at Oracle in the Java Platform Group with new features for Java 8 ("and beyond"), some of them are related with the platform performance.

You can watch the presentation at:


Leave a comment

Si no se indica lo contrario, el contenido de esta página se ofrece bajo Creative Commons Attribution-ShareAlike 3.0 License