RSS是否跟踪保留或已提交的内存? [英] Does RSS tracks reserved or commited memory?

查看:166
本文介绍了RSS是否跟踪保留或已提交的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了降低RSS,我正在Java 8上使用不同的jvm选项进行实验:

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

  • 用于Rss跟踪的脚本:

  • Script used for Rss tracking:

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

用于设置Java进程的JVM参数:

JVM args for setting up java process:

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

以jcmd作为基准:

jcmd $pid VM.native_memory baseline

与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)

问题 : 上面输出的RSS将考虑使用什么内存,是committed还是reserved?

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

推荐答案

保留/提交和居民/虚拟之间的关系要复杂一些. RSS覆盖物理内存中的 resident 页面.可以将已调出(或从未调出)的内容提交给内存,但不能驻留.

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.

这篇关于RSS是否跟踪保留或已提交的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆