I had a problem when I have a Java application that is sometimes killed by the oom killer on Linux after it runs out of memory. I controlled a bunch and it does not grow. In fact, he does not even reach the maximum allowed through Xmx
which he was 768MB
.
So I turned on tracking my own memory through -XX:NativeMemoryTracking=summary
. Then I launched the application, took the basic level and waited for the moment when it started to eat memory, after which I used jcmd <pid> VM.native_memory detail.diff
to create the next report.
Native Memory Tracking:
Total: reserved=16894180KB +14703341KB, committed=15330936KB +14896985KB
- Java Heap (reserved=786432KB, committed=450048KB +129536KB)
(mmap: reserved=786432KB, committed=450048KB +129536KB)
- Class (reserved=1185329KB +110708KB, committed=156657KB +128180KB)
(classes
(malloc=11825KB +2164KB
(mmap: reserved=1173504KB +108544KB, committed=144832KB +126016KB)
- Thread (reserved=16825159KB +16803246KB, committed=16825159KB +16803246KB)
(thread
(stack: reserved=47288KB +25472KB, committed=47288KB +25472KB)
(malloc=153KB +82KB
(arena=16777717KB +16777692
- Code (reserved=260509KB +9756KB, committed=63625KB +56100KB)
(malloc=10909KB +9756KB
(mmap: reserved=249600KB, committed=52716KB +46344KB)
- GC (reserved=39135KB +15KB, committed=37831KB +307KB)
(malloc=10399KB +15KB
(mmap: reserved=28736KB, committed=27432KB +292KB)
- Compiler (reserved=890284KB +890139KB, committed=890284KB +890139KB)
(malloc=55KB +41KB
(arena=890229KB +890098
- Internal (reserved=13299KB +3377KB, committed=13299KB +3377KB)
(malloc=13267KB +3377KB
(mmap: reserved=32KB, committed=32KB)
- Symbol (reserved=32729KB +27117KB, committed=32729KB +27117KB)
(malloc=28565KB +24400KB
(arena=4163KB +2717
- Native Memory Tracking (reserved=13011KB +12136KB, committed=13011KB +12136KB)
(malloc=367KB +241KB
(tracking overhead=12644KB +11895KB)
- Arena Chunk (reserved=18014398506330278KB -3153154KB, committed=18014398506330278KB -3153154KB)
(malloc=18014398506330278KB -3153154KB)
The report shows that the amount of memory used has increased significantly committed=15330936KB +14896985KB
, but this is not on the heap.
, , . , 1024KB
, 47288KB
47 .
Thread (reserved=16825159KB +16803246KB, committed=16825159KB +16803246KB)
(thread
(stack: reserved=47288KB +25472KB, committed=47288KB +25472KB)
(malloc=153KB +82KB
(arena=16777717KB +16777692
, , +16777692
. ? ? , ( stackoverflow), , .
, Arena . , , ?
JDK JDK-8164293, , JVM, ?