Date
1 - 3 of 3
Unnaccounted memory in Java application running in Cloud Foundry
Lorenzo Jorquera <lorenzo.jorquera@...>
Hello,
I am running a Java application in Cloud Foundry V3. The manifest indicates 2000Mb of memory. The Java memory parameters (obtained via jcmd) are as follow: -XX:CICompilerCount=3 -XX:+HeapDumpOnOutOfMemoryError -XX:InitialHeapSize=524288000 -XX:MaxHeapSize=641728512 -XX:MaxMetaspaceSize=268435456 -XX:MaxNewSize=213909504 -XX:MetaspaceSize=268435456 -XX:MinHeapDeltaBytes=524288 -XX:NativeMemoryTracking=summary -XX:NewSize=174587904 -XX:OldSize=349700096 -XX:ThreadStackSize=1024 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC So, the application has a heap size of ~ 600 Mb and a Metaspace size of ~ 256 Mb. However, if I execute top, I get: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 34 vcap 0 -20 5756056 1.574g 28632 S 0.3 10.7 3:12.94 java So for the operating system the process is using nearly 1.6 Gb, while the Heap and Metaspace are configured to only use 856Mb. I thought that it was possible that the difference would be in Native Memory, but the native memory reported usage is also much less than 1.6 Gb: cap(a)hqcquhb1si9:~$ /home/vcap/app/.java-buildpack/open_jdk_jre/bin/jcmd 34 VM.native_memory 34: Native Memory Tracking: Total: reserved=2203649KB, committed=960861KB - Java Heap (reserved=626688KB, committed=609280KB) (mmap: reserved=626688KB, committed=609280KB) So, my doubt is, what are this extra 700Mb? -- Lorenzo Jorquera |
|
Daniel Mikusa
Try running `jcmd <pid> VM.native_memory summary` to get a full summary of
the memory being used by the JVM. Looks like this. ``` $ jcmd 72082 VM.native_memory summary 72082: Native Memory Tracking: Total: reserved=3532459KB, committed=271627KB - Java Heap (reserved=2097152KB, committed=131072KB) (mmap: reserved=2097152KB, committed=131072KB) - Class (reserved=1065321KB, committed=18537KB) (classes #2667) (malloc=361KB #3182) (mmap: reserved=1064960KB, committed=18176KB) - Thread (reserved=30846KB, committed=30846KB) (thread #31) (stack: reserved=30720KB, committed=30720KB) (malloc=91KB #163) (arena=35KB #60) - Code (reserved=251209KB, committed=9669KB) (malloc=1609KB #2458) (mmap: reserved=249600KB, committed=8060KB) - GC (reserved=26595KB, committed=20167KB) (malloc=19727KB #205) (mmap: reserved=6868KB, committed=440KB) - Compiler (reserved=141KB, committed=141KB) (malloc=10KB #97) (arena=131KB #3) - Internal (reserved=630KB, committed=630KB) (malloc=598KB #4186) (mmap: reserved=32KB, committed=32KB) - Symbol (reserved=4603KB, committed=4603KB) (malloc=3124KB #23113) (arena=1479KB #1) - Native Memory Tracking (reserved=530KB, committed=530KB) (malloc=5KB #63) (tracking overhead=525KB) - Arena Chunk (reserved=196KB, committed=196KB) (malloc=196KB) - Unknown (reserved=55236KB, committed=55236KB) (mmap: reserved=55236KB, committed=55236KB) ``` Dan On Mon, May 9, 2016 at 5:54 PM, Lorenzo Jorquera < lorenzo.jorquera(a)servicemax.com> wrote: Hello, |
|
Lorenzo Jorquera <lorenzo.jorquera@...>
cap(a)hqcquhb1smb:~$ /home/vcap/app/.java-buildpack/open_jdk_jre/bin/jcmd 37
toggle quoted message
Show quoted text
VM.native_memory summary 37: Native Memory Tracking: Total: reserved=2128154KB, committed=836614KB - Java Heap (reserved=626688KB, committed=584192KB) (mmap: reserved=626688KB, committed=584192KB) - Class (reserved=1129321KB, committed=91881KB) (classes #17000) (malloc=7017KB #22067) (mmap: reserved=1122304KB, committed=84864KB) - Thread (reserved=52845KB, committed=52845KB) (thread #52) (stack: reserved=52428KB, committed=52428KB) (malloc=166KB #261) (arena=252KB #102) - Code (reserved=257053KB, committed=45609KB) (malloc=7453KB #9660) (mmap: reserved=249600KB, committed=38156KB) - GC (reserved=28679KB, committed=28519KB) (malloc=5779KB #353) (mmap: reserved=22900KB, committed=22740KB) - Compiler (reserved=240KB, committed=240KB) (malloc=109KB #300) (arena=131KB #3) - Internal (reserved=10528KB, committed=10528KB) (malloc=10496KB #20352) (mmap: reserved=32KB, committed=32KB) - Symbol (reserved=18889KB, committed=18889KB) (malloc=15748KB #175967) (arena=3141KB #1) - Native Memory Tracking (reserved=3595KB, committed=3595KB) (malloc=12KB #140) (tracking overhead=3583KB) - Arena Chunk (reserved=316KB, committed=316KB) (malloc=316KB) On Tue, May 10, 2016 at 9:14 AM, Daniel Mikusa <dmikusa(a)pivotal.io> wrote:
Try running `jcmd <pid> VM.native_memory summary` to get a full summary of --
Lorenzo Jorquera |
|