Tagged articles
34 articles
Page 1 of 1
Cognitive Technology Team
Cognitive Technology Team
Apr 9, 2025 · Backend Development

Understanding java.lang.OutOfMemoryError: Metaspace and How to Resolve It

java.lang.OutOfMemoryError: Metaspace occurs when the JVM's native Metaspace exceeds its configured limit, often due to excessive dynamic class generation, large numbers of loaded classes or classloader leaks, and can be mitigated by increasing Metaspace size, fixing memory leaks, and optimizing class loading.

JVMMemory ManagementMetaspace
0 likes · 5 min read
Understanding java.lang.OutOfMemoryError: Metaspace and How to Resolve It
DaTaobao Tech
DaTaobao Tech
Dec 11, 2024 · Backend Development

Resolving Metaspace and Off‑Heap Memory Issues After JDK 11 Upgrade

After upgrading core services to JDK 11, the team encountered a Metaspace rise and off‑heap memory growth caused by class‑loading changes and Netty’s disabled native buffers, which were resolved by expanding Metaspace to 768 MB and adding JVM options to enable Netty reflection and open required modules, restoring normal memory usage.

JDK11JVMMemoryLeak
0 likes · 8 min read
Resolving Metaspace and Off‑Heap Memory Issues After JDK 11 Upgrade
Sanyou's Java Diary
Sanyou's Java Diary
Oct 28, 2024 · Fundamentals

Master JVM Memory Troubleshooting: A Step‑by‑Step Guide

This comprehensive guide walks you through systematic JVM memory issue diagnosis, covering initial data collection, analysis of heap, metaspace, direct memory, stack problems, and practical command‑line tools, while offering actionable tips and real‑world examples for effective troubleshooting.

DirectMemoryHeapJVM
0 likes · 56 min read
Master JVM Memory Troubleshooting: A Step‑by‑Step Guide
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 23, 2024 · Fundamentals

Understanding JVM Memory Structure and Object Lifecycle

This article explains the JVM memory architecture—including heap, stack, native stack, method area, and program counter—detailing heap generations, object allocation strategies, object layout, reference types, and the complete lifecycle of Java objects from creation to garbage collection.

Garbage CollectionJVMMetaspace
0 likes · 11 min read
Understanding JVM Memory Structure and Object Lifecycle
JavaEdge
JavaEdge
Jul 8, 2024 · Backend Development

Master Java Metaspace: Tuning Metadata GC Threshold and JVM Flags

This article explains Java Metaspace and metadata GC thresholds, compares PermGen with Metaspace, and provides detailed JVM flag configurations—including size settings and compressed pointer options—to help developers optimize memory usage and garbage‑collection performance.

Garbage CollectionMemory ManagementMetaspace
0 likes · 8 min read
Master Java Metaspace: Tuning Metadata GC Threshold and JVM Flags
Java Backend Technology
Java Backend Technology
Mar 19, 2024 · Backend Development

6 Common Java OOM Scenarios and How to Prevent Them

This article explains six typical OutOfMemoryError situations in Java—heap, native thread, stack overflow, direct buffer, GC overhead, and Metaspace—provides code examples that trigger each issue, shows the resulting exception messages, and offers practical tips such as using thread pools, limiting recursion depth, adjusting GC settings, and configuring Metaspace to avoid these memory problems.

HeapJVMMetaspace
0 likes · 9 min read
6 Common Java OOM Scenarios and How to Prevent Them
Java Captain
Java Captain
Nov 8, 2023 · Fundamentals

Understanding Java OOM Errors: Heap, GC Overhead, Metaspace, CodeCache, Direct Memory, and Linux OOM Killer

This article explains the various Java OutOfMemoryError types—including Java heap space, GC overhead limit exceeded, Metaspace, CodeCache, Direct Memory, and Linux OOM Killer—describes their causes, typical symptoms, and provides step‑by‑step troubleshooting and mitigation strategies for developers.

CodeCacheJVMMemory Management
0 likes · 10 min read
Understanding Java OOM Errors: Heap, GC Overhead, Metaspace, CodeCache, Direct Memory, and Linux OOM Killer
JD Tech
JD Tech
Sep 18, 2023 · Fundamentals

Full GC Root Cause Analysis and Resolution in Java Applications

This article documents a step‑by‑step investigation of a high TP99 caused by frequent Full GC in a Java service, describing the diagnostic mindset, tools used, GC trigger conditions, object promotion mechanisms, the impact of AdaptiveSizePolicy and Metaspace, and the concrete configuration and code changes that eliminated the issue.

AdaptiveSizePolicyFullGCJVM
0 likes · 12 min read
Full GC Root Cause Analysis and Resolution in Java Applications
Sanyou's Java Diary
Sanyou's Java Diary
Dec 1, 2022 · Fundamentals

Mastering JVM Memory: From Heap to Metaspace and Beyond

This article provides a comprehensive overview of the Java Virtual Machine memory architecture, covering heap layout, object allocation, Metaspace, stack frames, native method stacks, program counters, direct memory, and code cache, complete with configuration tips and practical code examples.

Garbage CollectionHeapJVM
0 likes · 18 min read
Mastering JVM Memory: From Heap to Metaspace and Beyond
Programmer DD
Programmer DD
Jul 21, 2022 · Fundamentals

Understanding JVM Memory Layout: Heap, Metaspace, and Stack Explained

This article explains the JVM memory layout, covering the heap area, its configurable size and generational structure, the Metaspace replacement for PermGen, the thread‑private virtual machine stack and native method stack, as well as the program counter register and related garbage‑collection behavior.

HeapJVMMetaspace
0 likes · 14 min read
Understanding JVM Memory Layout: Heap, Metaspace, and Stack Explained
Top Architect
Top Architect
Jun 24, 2022 · Fundamentals

Understanding JVM Memory Layout: Heap, Metaspace, Stacks, and Program Counter

This article explains the JVM memory architecture, covering the heap (young and old generations, Eden and Survivor spaces), Metaspace, virtual machine stacks, native method stacks, and the program counter register, while also illustrating key JVM parameters and bytecode execution with examples.

Garbage CollectionHeapJVM
0 likes · 13 min read
Understanding JVM Memory Layout: Heap, Metaspace, Stacks, and Program Counter
Efficient Ops
Efficient Ops
Feb 10, 2022 · Operations

Why Did a Metaspace Misconfiguration Crash Our Elastic Cloud Service?

A production incident on an elastic‑cloud deployment revealed that setting the JVM Metaspace limit to 64 MiB, while the application required around 76 MiB, triggered continuous Full GC, causing stop‑the‑world pauses, full‑line time‑outs, and a costly rollback.

Elastic CloudJVMMetaspace
0 likes · 9 min read
Why Did a Metaspace Misconfiguration Crash Our Elastic Cloud Service?
Efficient Ops
Efficient Ops
Sep 23, 2021 · Operations

Why Did Our New Deployment Crash? Uncovering Metaspace‑Induced Full‑GC

The article recounts a staged rollout of the Maybach service on elastic cloud, details the timeline of successful and failing deployments, analyzes JVM metrics revealing excessive Metaspace usage that triggered continuous full garbage collections, and explains how this caused system‑wide timeouts and a half‑hour outage.

Full GCJVMMetaspace
0 likes · 10 min read
Why Did Our New Deployment Crash? Uncovering Metaspace‑Induced Full‑GC
Architect
Architect
Sep 9, 2021 · Fundamentals

Understanding JVM Memory Structure: Areas, Allocation, and Tuning

This article provides a comprehensive overview of the Java Virtual Machine memory layout, explaining each region such as the heap, metaspace, stack, program counter, direct memory and code cache, along with allocation strategies, tuning parameters, and practical OOM demonstrations.

Garbage CollectionHeapJVM
0 likes · 16 min read
Understanding JVM Memory Structure: Areas, Allocation, and Tuning
JavaEdge
JavaEdge
Jul 2, 2021 · Backend Development

How to Diagnose and Reproduce Different Java OOM Errors

This article explains the various types of Java OutOfMemoryError, shows how to trigger each one on HotSpot JVM, provides diagnostic steps and relevant JVM flags, and offers practical code examples for heap, stack, metaspace, and direct memory overflow scenarios.

DirectMemoryJVMMetaspace
0 likes · 16 min read
How to Diagnose and Reproduce Different Java OOM Errors
Selected Java Interview Questions
Selected Java Interview Questions
Mar 10, 2021 · Fundamentals

Understanding Java Heap, Stack, Metaspace, and Direct Memory OutOfMemoryError with Examples

This article explains the causes of various Java OutOfMemoryError scenarios—including heap, stack, metaspace, and direct memory overflow—provides diagnostic tools, shows reproducible code examples, and offers practical solutions such as adjusting JVM parameters and optimizing code to prevent memory exhaustion.

HeapJVMMetaspace
0 likes · 17 min read
Understanding Java Heap, Stack, Metaspace, and Direct Memory OutOfMemoryError with Examples
Xianyu Technology
Xianyu Technology
Dec 24, 2020 · Backend Development

Root Cause Analysis of Metaspace OOM Triggered by Arthas Trace

Tracing a large method with Arthas caused a Metaspace OOM because constant‑pool rewrites inflated the Non‑Class space, each rewrite copying a massive StackMapTable, but preserving the original constant‑pool layout in Arthas stops the growth, and exposing off‑heap metrics aids production monitoring.

ArthasJVMMetaspace
0 likes · 20 min read
Root Cause Analysis of Metaspace OOM Triggered by Arthas Trace
Selected Java Interview Questions
Selected Java Interview Questions
Jun 12, 2020 · Fundamentals

Deep Dive into Java ClassLoader, Class Loading Process, and the Parent‑Delegation Model

This article explains when and how Java classes are loaded, details the JVM's ClassLoader implementation—including the native defineClass1 method, InstanceKlass creation, SystemDictionary registration, and parallel loading locks—then demonstrates breaking the parent‑delegation model with a custom ClassLoader and discusses practical usage scenarios.

JVMMetaspaceParent Delegation
0 likes · 18 min read
Deep Dive into Java ClassLoader, Class Loading Process, and the Parent‑Delegation Model
Architect's Tech Stack
Architect's Tech Stack
Jan 18, 2020 · Fundamentals

JVM Memory Architecture: Overview, Heap, Metaspace, Stack, and More

This article provides a comprehensive overview of the Java Virtual Machine memory layout, covering heap regions, Metaspace, stack frames, native method stack, program counter, direct memory, and code cache, along with configuration tips, diagnostic commands, and illustrative code examples to help readers understand memory allocation and garbage collection.

Garbage CollectionHeapJVM
0 likes · 16 min read
JVM Memory Architecture: Overview, Heap, Metaspace, Stack, and More
Programmer DD
Programmer DD
Jun 14, 2019 · Fundamentals

Why Full GC Hits Metaspace Threshold and How to Resolve It

The article analyzes a recurring Full GC warning caused by Metaspace reaching its threshold, explains the underlying JVM mechanics, investigates dynamically generated reflection classes and SoftReference behavior, and provides a practical tuning solution by adjusting SoftRefLRUPolicyMSPerMB.

Full GCMetaspaceSoftReference
0 likes · 8 min read
Why Full GC Hits Metaspace Threshold and How to Resolve It