memory
14 tutorials tagged “memory”.
- Compact Object Headers in Java 25Java 25 can shrink object headers from 12 to 8 bytes with -XX:+UseCompactObjectHeaders. Learn how it works, measure the savings, and when to turn it on.
- Heap Dumps and Thread DumpsA heap dump captures every object; a thread dump shows what every thread is doing. Learn to take and read both to find leaks, hangs and deadlocks.
- JVM Memory AreasThe JVM divides memory into the heap, thread stacks, metaspace, the code cache and other native areas. Learn each area, what fills it, and how to see it.
- Memory Leaks in JavaA Java memory leak is an object the program no longer needs but still references. Learn the causes, then find and fix a real leak with histograms and dumps.
- Object Lifecycle and ReachabilityAn object is created, used while reachable, becomes unreachable, and is then collected. Learn the stages and how objects become unreachable.
- Object Memory Layout in JavaA Java object is a header plus its fields, padded to a multiple of 8 bytes. Learn the header, compressed references, and how to measure object sizes.
- OutOfMemoryError Types and CausesEach OutOfMemoryError message names the memory area that ran out. Learn the heap, Metaspace, direct buffer and thread variants and how to fix each.
- Strong, Weak, Soft and Phantom ReferencesJava has four reference strengths. Learn how strong, soft, weak and phantom references affect garbage collection, with examples, ReferenceQueue and Cleaner.
- Stack vs Heap Memory in JavaThe stack holds method calls and local variables per thread; the heap holds all objects, shared by threads. Learn what goes where and their errors.
- Where the String Pool LivesSince Java 7, pooled strings live on the heap and the JVM keeps a table of references to them. Learn how to see the pool and how it is garbage collected.