I am using below JVM opts in my application on Linux server
-server -Xms3g -Xmx3g -Xmn512m -XX:MaxPermSize=256m -Xss256k -Xloggc:${gc_log_file}
-verbose:gc -XX:+DoEscapeAnalysis -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
-XX:TargetSurvivorRatio=80
-Dsun.rmi.dgc.server.gcInterval=300000 -Dsun.rmi.dgc.client.gcInterval=300000
-XX:+AggressiveOpts
-XX:+PrintTenuringDistribution -XX:+PrintConcurrentLocks -XX:MaxTenuringThreshold=20
But this setting was not effective on that node and MaxPermSize is taken as 140m instead of 256m
Details:
MemTotal: 5925728 kB
java version "1.7.0_251"
Heap
PSYoungGen total 471040K, used 122995K [0x00000007e0000000, 0x0000000800000000, 0x0000000800000000)
eden space 416256K, 25% used [0x00000007e0000000,0x00000007e6784d38,0x00000007f9680000)
from space 54784K, 31% used [0x00000007fca80000,0x00000007fdb18000,0x0000000800000000)
to space 53248K, 0% used [0x00000007f9680000,0x00000007f9680000,0x00000007fca80000)
ParOldGen total 2621440K, used 1146547K [0x0000000740000000, 0x00000007e0000000, 0x00000007e0000000)
object space 2621440K, 43% used [0x0000000740000000,0x0000000785face28,0x00000007e0000000)
PSPermGen total 140800K, used 140471K [0x0000000730000000, 0x0000000738980000, 0x0000000740000000)
object space 140800K, 99% used [0x0000000730000000,0x000000073892de90,0x0000000738980000)
As per gclog statements, PermGen reached 99% when it reached 140m
object space 140800K, 99% used
How to force java process to consider MaxPermSize VM opts for PermGen?
140800Kis the allocated permanent generation, not the maximum allocable.If you don't kill it, you will see the permanent generation growing to accomodate new allocations.