MAC TOP manpage

本文详细解释了top命令中与内存相关的各项指标含义,包括resident、private和shared等概念,并阐述了这些指标如何帮助理解进程的内存使用情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

            pid    Process ID (default).

              command
                     Command name.

              cpu    CPU usage.

              csw    Number of context switches.

              time   Execution time.

              threads
                     alias: th
                     Number of threads (total/running).

              ports  alias: prt
                     Number of Mach ports.

              mregion
                     alias: mreg, reg
                     Number of memory regions.

              rprvt  Resident private address space size.

              rshrd  Resident shared address space size.

              rsize  Resident memory size.

              vsize  Total memory size.

              vprvt  Private address space size.

              kprvt  Private kernel memory size.

              kshrd  Shared kernel memory size.

              pgrp   Process group id.

              ppid   Parent process id.

              state  alias: pstate
                     Process state.

              uid    User ID.

              wq     alias: #wq, workqueue
                     The workqueue total/running.

              faults alias: fault
                     The number of page faults.

              cow    alias: cow_faults
                     The copy-on-write faults.

              user   alias: username Username.

              msgsent
                     Total number of mach messages sent.

              msgrecv
                     Total number of mach messages received.

              sysbsd Total BSD syscalls.

              sysmach
                     Total Mach syscalls.

              pageins
                     Total pageins.



Definitions
Now that we know roughly how the stuff works, let's define some memory-related terms:


Resident: memory which is located in physical RAM.
Private: memory which is only mapped into one process.
Shared: memory which is mapped into multiple processes.
Address space size: the quantity of address space occupied by a particular section of virtual memory.
Memory size: the amount of actual physical memory occupied.
And with that, we can now see what the various fields in top mean, from looking at the man page and using these definitions:
RPRVT: The amount of address space, local to this process, which corresponds to items currently present in physical RAM.
RSHRD: The amount of address space, shared between this process and at least one other, which corresponds to items currently present in physical RAM.
RSIZE: The total amount of physical RAM used by this process. (This is not equal to RPRVT + RSHRD because they measure address space, but this measures actual memory.)
VPRVT: The amount of address space in the process mapped to items which are not shared with other processes.
VSIZE: The total amount of address space in the process that's mapped to anything.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值