How much memory do your objects really use?
summary
Explains JVM object headers, alignment and reference sizes, and uses a Java instrumentation agent plus reflection to walk object graphs and get exact sizes. Shows concrete numbers: "hello" string ≈72 bytes, a 4-string POJO ≈256 bytes versus LinkedHashMap ≈744 bytes, ArrayMap ≈2× object. Demonstrates a tool that measures deep object graph sizes and applies it to a real case—10,000 items × ~3KB → ~30MB—prompting a decision to stop eager in‑memory DB loading. code and GitHub links provided
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:18Out of Memory
- 5:27Data Types
- 9:06Instrumentation Tools
- 9:40Project Overview
- 10:53RigInSize
- 17:53Comparing Data Structures
- 22:35Sample Objects
- 24:09Inspecting Data Structures
- 26:36Questions








