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

概述

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

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

AIX

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

支持的参数值 描述Sourcen procentry64 structure Tries tbe compatible with
vsize (( - default value))虚拟内存大小 pisze
pmem实际内存的百分比 pi_prmps -o pem
rss驻留集大小 pirss + pi_drss ps -rssize
size进程大小(代码+数据) pi_dvm“ps gvwSIZE column
dsize数据大小 pi
dsize
tsize文本(代码)的大小 pi_tsze “ps gv“ TSIZ column
sdsize来自共享库的数据大小 pi_sdsiz
drss数据驻留集大小 pi_drs
trss文本驻留集大小 pi_trs

FreeBSD

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

Supported valueDescriptionSource in kinfoproc structureTries to be compatible with
vsize虚拟内存大小 kp_eroc.e_vm.vm_map.size or ki_size ps -ovsz
pmem实际内存的百分比 calculaed from rss ps -o pem
rss驻留集大小 kpproc.e_vm.vm_rssize or ki_rssize ps -rss
size (( - default value))进程(代码+数据+堆栈)大小 tsize + dize + ssize
tsize文本(代码)的大小 kp_epoc.e_vm.vm_tsize or ki_tsize ps -osiz
dsize数据大小 kp
eproc.e_vm.vm_dsize or ki_dsize pso dsiz
ssize堆栈大小 kp
eproc.e_vm.vm_ssize or ki_ssize pso ssiz

Linux

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

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

Linux上注意事项:

  1. 一些旧版本Linux 内核并不是支持所有’memtype’ 值的。例如, Linux 内核版本2.4就不支持 hwm, pin, peak, pteswap 等值。
  2. 我们发现 Zabbix agent 主动检查进程参数proc.mem[...,...,...,...,data] 显示的值比agent 的 /proc/<pid>/status 文件中 VmData行的值大大 4 kB。在agent自我监控管理时,agent的数据碎片增长率4 kB ,然后又返回到先前的值。

Solaris

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

支持的参数值 描述Sourcen psinfo structure 兼容
vsize (( - default value))Size of process imageprsizeps -o vsz
pmem实际内存的百分比 pr_pctem ps -o pem
rss驻留集大小  pr可能会被低估 - 参看 “man ps”中rss描述.ssize ps -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 (( - default value))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 (( - default value))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 (( - default value))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/<pid>/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 (( - default value))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