java.exe process uses more memory and does not free it up

前端 未结 2 1885
-上瘾入骨i
-上瘾入骨i 2020-12-06 07:13

I have a java application which when in idle state before any complex executions, uses 23 MB in Heap and the java.exe process size in TaskManager was around 194 MB. After so

2条回答
  •  孤城傲影
    2020-12-06 07:43

    OS footprint of java process are composed from

    • java heap (it's size in limited by -Xmx)
    • java classes related metadata (or permanent generation in HotSpot JVM)
    • non-heap memory accessible via NIO
    • stack space for java threads

    Some garbage collection algorithms are returning free memory back to OS, other do not. In HotSpot JVM, serial old space collector (usually enabled by default) are returning memory back to OS (so you can see shrinking of process). Though, other collector such as -XX:+UseParallelOldGC or -XX:+UseConcMarkSweepGC will never return unused heap memory to OS.

    HotSpot JVM has options to manage / limit all memory areas mentioned above, you can find comprehensive list of JVM options related to memory sizing and GC tuning in my blog.

提交回复
热议问题