Does RSS tracks reserved or commited memory?

拥有回忆 提交于 2019-12-14 03:47:07

问题


I'm running experiments with different jvm options on java 8 in order to lower RSS:

  • Script used for Rss tracking:

    ps -o rss -o vsz -o pid $pid

  • JVM args for setting up java process:

    -XX:+PrintNMTStatistics -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=detail

  • Taking baseline with jcmd:

    jcmd $pid VM.native_memory baseline

  • Taking diff with jcmd:

    jcmd $pid VM.native_memory summary.diff

Output (partial for Thread area):

-                    Thread (reserved=130696KB -21564KB, committed=130696KB -21564KB)
                            (thread #121 -21)
                            (stack: reserved=130048KB -21504KB, committed=130048KB -21504KB)
                            (malloc=379KB -67KB #610 -105)
                            (arena=268KB +7 #240 -42)

Question: What memory will be taken into account for RSS from output above, is it committed or reserved?


回答1:


The relation between reserved/committed and resident/virtual is a little more complex. RSS covers pages resident in physical memory. Things that have been paged out (or never paged in) can be be committed memory but not resident.

Maybe this answers your question: reserved-but-not-committed pages cannot be resident.



来源:https://stackoverflow.com/questions/31071019/does-rss-tracks-reserved-or-commited-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!