8 proc.mem 监控项中memtype参数类型的注意事项

概述

Linux, AIX, FreeBSD 和 Solaris 都支持memtype参数。

‘memtype’ 参数的三个常用值 pmem, rssvsize在所有系统中都适用。另外, 在一些系统中只支持该系统下的 ‘memtype’ 值。

AIX

请参见表中AIX上的“memtype”参数所支持的值.

支持的参数值描述Source in procentry64 structureTries to be compatible with
vsize 1)虚拟内存大小pi_size
pmem实际内存的百分比pi_prmps -o pmem
rss驻留集大小pi_trss + pi_drssps -o rssize
size进程大小(代码+数据)pi_dvm“ps gvw” SIZE column
dsize数据大小pi_dsize
tsize文本(代码)的大小pi_tsize“ps gvw” TSIZ column
sdsize来自共享库的数据大小pi_sdsize
drss数据驻留集大小pi_drss
trss文本驻留集大小pi_trss

FreeBSD

请参见表中FreeBSD上的“memtype”参数支持的值。

Supported valueDescriptionSource in kinfo_proc structureTries to be compatible with
vsize虚拟内存大小kp_eproc.e_vm.vm_map.size or ki_sizeps -o vsz
pmem实际内存的百分比calculated from rssps -o pmem
rss驻留集大小kp_eproc.e_vm.vm_rssize or ki_rssizeps -o rss
size 2)进程(代码+数据+堆栈)大小tsize + dsize + ssize
tsize文本(代码)的大小kp_eproc.e_vm.vm_tsize or ki_tsizeps -o tsiz
dsize数据大小kp_eproc.e_vm.vm_dsize or ki_dsizeps -o dsiz
ssize堆栈大小kp_eproc.e_vm.vm_ssize or ki_ssizeps -o ssiz

Linux

请参见表中Linux上的“memtype”参数支持的值。

Supported valueDescriptionSource in /proc/<pid>/status file
vsize 3)虚拟内存大小VmSize
pmem实际内存的百分比(VmRSS/total_memory) * 100
rss驻留集大小VmRSS
data数据段的大小VmData
exe代码段的大小VmExe
hwm驻留集峰值大小VmHWM
lck锁定内存大小VmLck
lib共享库的大小VmLib
peak虚拟内存峰值大小VmPeak
pin固定的页面大小VmPin
pte页表条目的大小VmPTE
size进程码+数据+栈段大小VmExe + VmData + VmStk
stk堆栈段大小VmStk
swap使用的交换空间大小VmSwap

Linux上注意事项:

  1. 一些旧版本Linux 内核并不是支持所有’memtype’ 值的。例如, Linux 内核版本2.4就不支持 hwm, pin, peak, pteswap 等值。

  2. 我们发现 Zabbix agent 主动检查进程参数proc.mem[…,…,…,…,data] 显示的值比agent 的 /proc//status 文件中 VmData行的值大大 4 kB。在agent自我监控管理时,agent的数据碎片增长率4 kB ,然后又返回到先前的值。

Solaris

请参见表中的Solaris上的“memtype”参数所支持的值。

支持的参数值描述Source in psinfo structure兼容
vsize 4)Size of process imagepr_sizeps -o vsz
pmem实际内存的百分比pr_pctmemps -o pmem
rss驻留集大小
可能会被低估 - 参看 “man ps”中rss描述.
pr_rssizeps -o rss

8 Notes on memtype parameter in proc.mem items

Overview

The memtype parameter is supported on Linux, AIX, FreeBSD, and Solaris platforms.

Three common values of ‘memtype’ are supported on all of these platforms: pmem, rss and vsize. Additionally, platform-specific ‘memtype’ values are supported on some platforms.

AIX

See values supported for ‘memtype’ parameter on AIX in the table.

Supported valueDescriptionSource in procentry64 structureTries to be compatible with
vsize 5)Virtual memory sizepi_size
pmemPercentage of real memorypi_prmps -o pmem
rssResident set sizepi_trss + pi_drssps -o rssize
sizeSize of process (code + data)pi_dvm“ps gvw” SIZE column
dsizeData sizepi_dsize
tsizeText (code) sizepi_tsize“ps gvw” TSIZ column
sdsizeData size from shared librarypi_sdsize
drssData resident set sizepi_drss
trssText resident set sizepi_trss

FreeBSD

See values supported for ‘memtype’ parameter on FreeBSD in the table.

Supported valueDescriptionSource in kinfo_proc structureTries to be compatible with
vsizeVirtual memory sizekp_eproc.e_vm.vm_map.size or ki_sizeps -o vsz
pmemPercentage of real memorycalculated from rssps -o pmem
rssResident set sizekp_eproc.e_vm.vm_rssize or ki_rssizeps -o rss
size 6)Size of process (code + data + stack)tsize + dsize + ssize
tsizeText (code) sizekp_eproc.e_vm.vm_tsize or ki_tsizeps -o tsiz
dsizeData sizekp_eproc.e_vm.vm_dsize or ki_dsizeps -o dsiz
ssizeStack sizekp_eproc.e_vm.vm_ssize or ki_ssizeps -o ssiz

Linux

See values supported for ‘memtype’ parameter on Linux in the table.

Supported valueDescriptionSource in /proc/<pid>/status file
vsize 7)Virtual memory sizeVmSize
pmemPercentage of real memory(VmRSS/total_memory) * 100
rssResident set sizeVmRSS
dataSize of data segmentVmData
exeSize of code segmentVmExe
hwmPeak resident set sizeVmHWM
lckSize of locked memoryVmLck
libSize of shared librariesVmLib
peakPeak virtual memory sizeVmPeak
pinSize of pinned pagesVmPin
pteSize of page table entriesVmPTE
sizeSize of process code + data + stack segmentsVmExe + VmData + VmStk
stkSize of stack segmentVmStk
swapSize of swap space usedVmSwap

Notes for Linux:

  1. Not all ‘memtype’ values are supported by older Linux kernels. For example, Linux 2.4 kernels do not support hwm, pin, peak, pte and swap values.

  2. We have noticed that self-monitoring of the Zabbix agent active check process with proc.mem[…,…,…,…,data] shows a value that is 4 kB larger than reported by VmData line in the agent’s /proc//status file. At the time of self-measurement the agent’s data segment increases by 4 kB and then returns to the previous size.

Solaris

See values supported for ‘memtype’ parameter on Solaris in the table.

Supported valueDescriptionSource in psinfo structureTries to be compatible with
vsize 8)Size of process imagepr_sizeps -o vsz
pmemPercentage of real memorypr_pctmemps -o pmem
rssResident set size
It may be underestimated - see rss description in “man ps”.
pr_rssizeps -o rss

1) , 2) , 3) , 4) , 5) , 6) , 7) , 8)

- default value