JAX London, 3–6 October 2022
The Conference for Java & Software Innovation

No Free Lunch? Memory Allocation in the JVM

Tuesday, October 6 2020
15:00 - 15:45

Ever wondered how memory allocation on the JVM works?The Java Virtual Machine features many generational garbage collectors that also use pointer bumping for allocation. The combination of these two techniques gives a fast allocation and collection path which has led to a commonly held belief in the Java community that allocation in general is cheap. This talk will challenge that belief by looking at what happens outside of the fast path and considering the impact of even fast path allocation on other parts of the system, such as caches and memory bandwidth.

You will see how optimisations from the JIT can reduce or eliminate many allocations but how reasoning about when these happen can be almost impossible from glancing at code. Examples will introduce you to common problems and tooling you can use to understand the allocation behaviour of your code.

From attending this talk you will understand:

– How allocation works in modern JVM Garbage Collectors

– Why allocation isn’t necessarily as cheap as it seems

– Why the JVM makes it difficult to reason about allocation behaviour by code examination

– What kind of tooling you can use to understand the real allocation behaviour of your code

Behind the Tracks

Software Architecture & Design
Software innovation & more
Architecture structure & more
Agile & Communication
Methodologies & more
Emerging Technologies
Everything about the latest technologies
DevOps & Continuous Delivery
Delivery Pipelines, Testing & more
Cloud & Modern Infrastructure
Everything about new tools and platforms
Big Data & Machine Learning
Saving, processing & more