Metaspace is Java 8's new memory space for storing class meta-data information, and that grows automatically unlike its predecessor PermGen space.
Questions tagged [metaspace]
98 questions
1
vote
0 answers
Why Metaspace size in the gc log file is greater than MaxMetaspaceSize parameter
I'm running my java application under java 8 and I'm noticing a strange behaviour in my gc log file:
Java HotSpot(TM) 64-Bit Server VM (25.131-b11) for linux-amd64 JRE (1.8.0_131-b11), built on Mar 15 2017 01:23:40 by "java_re" with gcc 4.3.0…

Zizou
- 831
- 1
- 10
- 19
1
vote
0 answers
How to read Java 8 metaspace dump
We have been suffering metaspace OOM recently for our application due to groovy stuff, however, I managed to cache compiled script to stop it happening right now.
Previously, the process crashed at least once a day. It has been running fine for at…

machinarium
- 631
- 6
- 17
1
vote
2 answers
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Metaspace
I am facing a problem of metaSpace in my project.
I am using Scala IDE in which Spark 2.3.1, Play framework 2.6, Scala 2.11
While running sbt run, I get a meta-space error.
Also, I had tried to run sbt clean.
But it gives the same error:

priyanka patel
- 35
- 4
1
vote
1 answer
JVM metaspace is filled after minor garbage collection
I have been looking into Java memory management and various sections in the heap memory like eden, s0, s1, old gen and metaspace. I was using VisualGC for tracking how memory is filled among different sections of heap. I noticed there is a sharp…

meesun
- 181
- 1
- 8
1
vote
1 answer
Java Hosting APR based Apache Tomcat Error
I think this is a 2 part question.
My versions:
I developed using Java jdk1.8.0_144,
Server JVM jdk1.8.0_77,
Server Tomcat apache-tomcat-8.5.23
Error:
16-Apr-2018 11:57:31.041 SEVERE [http-nio-13571-exec-1]…

Quentinb
- 476
- 1
- 9
- 30
1
vote
1 answer
Where are Metaspace and Runtime Constant pools in JVM's memory?
I'm confused with Metaspace in Java. Where is it?
Some articles treating PermGen(Metaspace) as part of the heap, some of them as heap-off part of memory:
Method Area (part of Metaspace) is the part of heap…

Pronto Violetas
- 43
- 5
1
vote
1 answer
Why does Java throw java.lang.OutOfMemoryError: Metaspace but there is plenty of free metaspace?
In my application I'm creating lots of java classes at runtime with javassist library. At some point a java.lang.OutOfMemoryError: Metaspace is thrown but java process monitoring (based on java.lang.management.MemoryPoolMXBean) reports that there is…

vitvlkv
- 782
- 7
- 13
1
vote
0 answers
Metaspace issue after switching to JDK 8 and Tomcat 8
I am facing issue with Meta space piling up and its not clearing even during major GC. Below are my Tomcat JVM
-XX:+UseAdaptiveGCBoundary -XX:+UseG1GC -XX:CompressedClassSpaceSize=1024m -XX:MaxMetaspaceSize=1024m -Xms2048m -Xmx2048m
(I am running…

Prabahar
- 51
- 1
- 3
1
vote
1 answer
Out of Memory : Metaspace with java 8
My product has 256 MB of RAM. I have upgrade java 6 to java 8.
Then I started facing memory related issue with java 8.
memory consumption is incresing by the time with Java 8
With same code, memory consumption is stable with java 6
I have explored…

Smash
- 63
- 3
- 9
1
vote
1 answer
Why class can not be loaded by URLClassLoader?
I want to simulate metaspace OOM. I plan to load class ClassA by different URLClassLoader, here is the code:
package classloader;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import…

expoter
- 1,622
- 17
- 34
1
vote
0 answers
Java 8 VM.native_memory
I'm having hard times with java 8 metaspace memory management. I'm currently using jdk 1.8_60 on RHEL.
this is my tomcat…

bilak
- 4,526
- 3
- 35
- 75
1
vote
1 answer
Metaspace and Garbage Collections
I'm having a few issues with the Metaspace filling up and I'm trying to figure out how GCs work over it. I have read here that minor GCs increment the usage of the Metaspace. I have been reading the literature around it as well and I haven't been…

Tavo
- 3,087
- 5
- 29
- 44
0
votes
0 answers
How does JVM know the address of a class in metaspace?
I learned that getting the value of a static field uses an offset from the beginning of the class data in the metaspace. (How exactly do static fields work internally?) But how does the jvm know the address of the class in metaspace?
I tried…

EvMV
- 1
- 1
0
votes
0 answers
OpenJDK JVM memory layout (Metaspace, Code Cache, Heap, Non-Heap, Runtime Constant Pool)
This question might seem like a duplicate or like a too much open question, but after long research I decided to ask it anyway.
I am looking for an updated (2023) overview of OpenJDK JVM Memory Layout, containing all important elements of the…

fascynacja
- 1,625
- 4
- 17
- 35
0
votes
1 answer
Classloader Leak while Deserializing KieBase
I'm using drools-core 7.68.0.Final to serialize a KieBase using DroolsObjectOutputStream. Each time that I subsequently deserialize the KieBase back into memory using DroolsObjectInputStream I get a new/separate instance of the…