Metaspace Internals

Metaspace internals on JDK 16+: chunk and arena allocation per ClassLoaderData, the compressed class space and its separately configured reservation/limit, chunk waste and fragmentation, when memory is actually returned to the OS, and reading `jcmd VM.metaspace` and the nested `VM.native_memory` output. Use when `OutOfMemoryError: Metaspace` or `Compressed class space` is thrown, when a container is OOMKilled with a healthy heap, when metaspace committed grows monotonically, when `MaxMetaspaceSize` is unset or copied from another service, when `waste` in the class space is climbing, or when proxies, hidden classes or a scripting engine generate classes at runtime. Does not cover the process-wide memory map and container budget (jvm-memory-regions), classloader identity, unloading and the retainer hunt for a leak (jvm-class-loading), or anything about compiled code and the code cache (code-cache-segments).

robsonkades 25f0a30 5 files · 36.7 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/metaspace-internals commit 25f0a30e07

Frequently asked questions

npx skillmds@latest add robsonkades/metaspace-internals