Re: "ps -o %mem" and free memory in Linux
- To: Victor Sudakov <vas@sibptus.ru>
- Cc: debian-user@lists.debian.org
- Subject: Re: "ps -o %mem" and free memory in Linux
- From: Fabrice BAUZAC-STEHLY <noon@mykolab.com>
- Date: Fri, 02 Oct 2020 21:49:17 +0200
- Message-id: <[🔎] 877ds82yte.fsf@asus>
- In-reply-to: <20200929155038.GD61876@admin.sibptus.ru>
- References: <20200929032435.GA37589@admin.sibptus.ru> <ab7c8918eda4170013f17f05e5f739b95523e7e1.camel@yxit.co.uk> <20200929151403.GA61876@admin.sibptus.ru> <20200929153012.GA1325@singvogel.net> <20200929155038.GD61876@admin.sibptus.ru>
Victor Sudakov writes:
> I summed up with awk the values of %mem, which are supposed to be "ratio
> of the process's resident set size to the physical memory", correct?
>
> In my understanding, the value of %mem should indicate how much physical
> memory is spent on the "individual" part of the process, otherwise the
> parameter is either useless or misdocumented.
No, in resident memory you can find memory private to a process as well
as memory shared between processes.
And in memory private to a process, you can find resident memory and
non-resident memory.
According to Linux's Documentation/filesystems/proc.txt, we can find
this information in /proc/PID/status:
VmData size of private data segments
e.g. VmData: 123004 kB
This looks like the amount of private memory, but I'm not sure.
--
Fabrice BAUZAC-STEHLY
PGP 015AE9B25DCB0511D200A75DE5674DEA514C891D
Reply to: