Simulating and Analyzing Java Metaspace OutOfMemoryError

Metaspace OverviewThe Metaspace replaces the legacy Permanent Generation (PermGen) in HotSpot JVMs as the storage location for class metadata. Unlike the Java heap, this area allocates memory from native address space. It holds critical data such as loaded class structures, method bytecodes, static variables, and runtime constant pools. Since i ...

Posted on Sun, 16 Aug 2026 16:33:32 +0000 by codygoodman

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