~/talk

No Free Lunch? Memory Allocation in the JVM

Talkat JAX London 2020 · 2020-10-05..10-08· [java, web-performance]
links:none on file
links:none on file
slides:none on file

Claim: allocation on the JVM is not free — the JVM uses pointer bumping into per-thread TLABs but off-fast-path allocation triggers GC work, cache pollution and safepoint overhead. Measurement: instrumentation profilers can slow apps 2–3× and break JIT optimizations, while sampling allocation profiling runs in production with ~1% overhead. Surprises: integer caching only covers -128..127, ArrayList.removeIf can allocate a long[] “death row” bitset, and a demo shows periodic spikes where ~75% of time is spent pausing for GC.

AI-written summary · about

  1. 0:00Intro
  2. 2:53What do we mean by memory allocation?
  3. 4:32Pointer bumping theory
  4. 7:30How does allocation work?
  5. 10:14Memory Hierarchy
  6. 17:23Autoboxing
  7. 18:54Strings
  8. 20:17Immutable APIs and factory methods
  9. 22:06Expected Allocation but not: Scalar Replacement
  10. 26:27Instrumenting Allocation Profiling
  11. 28:10Sampling Allocation Profiling
  12. 30:01Example: Unexpected Allocation
  13. 35:44Example: allocation in larger codebases
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.