JVM Memory Structure: Understanding the Heap
1. Structure Diagram
2. Heap
Objects reside in the heap: their size is unpredictable and can change dynamically.
The stack holds primitive values and object referances; each reference is typically 4 bytes.
2.1 Characteristics
Nearly all objects are allocated on the heap.
Heap memory is fully managed by the JVM through automatic garbage col ...
Posted on Sat, 20 Jun 2026 18:02:37 +0000 by atomm
Simulating and Diagnosing JVM Out-of-Memory Errors in Spring Boot
Reproducing Heap Exhaustion
Bootstrap a Spring Boot application and add the web starter dependancy:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Implement an endpoint that continuously reserves large blocks of memory:
import o ...
Posted on Wed, 27 May 2026 22:12:06 +0000 by tomtimms
Memory-Safe Queue Implementations: Preventing OutOfMemoryErrors in Java Applications
Hello everyone.
Recently, I came across an interesting pull request in an open-source project on GitHub:
Just from the name containing "MemorySafe", I was immediately intrigued.
Let me show you what caught my attention:
This should look familiar - I took this screenshot from Alibaba's development guidelines.
Why are FixedThreadPool an ...
Posted on Sat, 16 May 2026 13:05:50 +0000 by hungryOrb