Save Java memory
summary
Shows how to measure object footprints using runtime allocation, OOME counting, profilers (VisualVM, Flight Recorder) and Java Object Layout to get precise header, alignment and padding numbers; an Integer object costs ~20 bytes, a String + char[] ~45–60 bytes. Replaces boxed objects with primitive collections (fastutil/Trove style), uses off-heap Chronicle Map or packed bitfields, and reports typical wins: single-collection swaps cut RAM by ~30% and switching to primitives yields up to ~100% speedups while dramatically reducing GC pressure.
AI-written summary · about
chapters (8)
- 0:00Introduction to optimization
- 2:05Measuring memory footprint
- 9:45Understanding object overhead
- 12:29Common class inefficiencies
- 18:11Advanced data representations
- 24:07Using primitive collections
- 32:47Off-heap serialization
- 35:00Conclusion and JIT impact








