Running the below spring boot application with ~100GB. The node has a total of 186G memory. The process got killed once the available memory reached zero.
/usr/java/1.8/bin/java -Xmx105104m -Xms105104m -XX:+UseParallelGC -XX:-OmitStackTraceInFastThrow -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:MaxGCPauseMillis=999 -XX:GCTimeRatio=19 -XX:NativeMemoryTracking=detail -XX:+PrintClassHistogram -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:logs/gc.log -XX:+UseGCLogFileRotation -XX:GCLogFileSize=4M -XX:NumberOfGCLogFiles=5 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=logs -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote.port=33333 -Dcom.sun.management.jmxremote.rmi.port=33333 -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -classpath /tmp/test.jar
The total reserved memory is ~108GB based the below memory summary.
/usr/java/1.8/bin/jcmd 39169 VM.native_memory summary 39169: Native Memory Tracking:
Total: reserved=116072104KB, committed=116020952KB
-
Java Heap (reserved=107626496KB, committed=107626496KB) (mmap: reserved=107626496KB, committed=107626496KB)
-
Class (reserved=269229KB, committed=268973KB) (classes #37441) (malloc=43949KB #111442) (mmap: reserved=225280KB, committed=225024KB)
-
Thread (reserved=2185937KB, committed=2185937KB) (thread #2117) (stack: reserved=2175044KB, committed=2175044KB) (malloc=7277KB #12696) (arena=3616KB #4217)
-
Code (reserved=291291KB, committed=240399KB) (malloc=41691KB #52137) (mmap: reserved=249600KB, committed=198708KB)
-
GC (reserved=3971460KB, committed=3971460KB) (malloc=39360KB #2400) (mmap: reserved=3932100KB, committed=3932100KB)
-
Compiler (reserved=6110KB, committed=6110KB) (malloc=5965KB #9682) (arena=145KB #18)
-
Internal (reserved=1663307KB, committed=1663303KB) (malloc=1663271KB #81858) (mmap: reserved=36KB, committed=32KB)
-
Symbol (reserved=45400KB, committed=45400KB) (malloc=41748KB #429276) (arena=3652KB #1)
Native Memory Tracking (reserved=12387KB, committed=12387KB) (malloc=1150KB #15182) (tracking overhead=11237KB)
-
Arena Chunk (reserved=489KB, committed=489KB) (malloc=489KB)
The smaps command is showing 133GB memory consumption. The process keeps growing memory consumption to the maximum OS memory(186GB) and then the process got killed. Should the java process take more than allocated?
cat /proc/39169/smaps | grep -i pss | awk '{Total+=$2} END {print Total/1024/1024" GB"}'
133.006 GB
cat /proc/39169/smaps | grep -i 'Private_Dirty' | awk '{Total+=$2} END {print Total/1024/1024" GB"}'
132.975 GB