What is java.lang.OutOfMemoryError: PermGen space?
Ans:
The
java.lang.OutOfMemoryError: PermGen space
message indicates that the Permanent Generation’s area in memory is exhausted.
Any Java applications is allowed to use a limited amount of memory. The exact amount of memory your particular application can use is specified during application startup.
What will be the solution for this error PermGen space?
Ans:
For Heap,
export JVM_ARGS="-Xms1024m -Xmx1024m"
For Permgen,
JVM_ARGS="-XX:PermSize=512M -XX:MaxPermSize=512m"
You can give also additional section
-XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC XX:+CMSClassUnloadingEnabled
You can also give more additional section :)
-XX:PermSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:SurvivorRatio=2 -XX:MaxTenuringThreshold=128 -XX:TargetSurvivorRatio=90 -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:+UseTLAB -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled
Metaspace: A new memory space is born
The
JDK 8 HotSpot JVM
is now using native memory for the representation of class metadata and is called Metaspace
; similar to the Oracle JRockit
and IBM JVM's
.
The good news is that it means no more
java.lang.OutOfMemoryError: PermGen space
problems and no need for you to tune and monitor this memory space anymore.
Related Link:
- https://plumbr.eu/outofmemoryerror/java-heap-space
- https://plumbr.eu/outofmemoryerror/permgen-space
- http://stas-blogspot.blogspot.in/2011/07/most-complete-list-of-xx-options-for.html#UseConcMarkSweepGC
- https://www.javacodegeeks.com/2013/12/decoding-java-lang-outofmemoryerror-permgen-space.html
- http://www.javavillage.in/reasons-outofmemory-permespace.php
- Dealing with "java.lang.OutOfMemoryError: PermGen space" error
Java 8 Links
- What is the use of MetaSpace in Java 8?
- https://blogs.oracle.com/poonam/entry/about_g1_garbage_collector_permanent
- https://plumbr.eu/outofmemoryerror/metaspace
- https://dzone.com/articles/java-8-permgen-metaspace
Original Link: java.lang.OutOfMemoryError: PermGen space Exception
No comments:
Post a Comment