[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Questions about proced
From: |
Rahguzar |
Subject: |
Re: Questions about proced |
Date: |
Wed, 24 Jul 2024 18:31:59 +0200 |
User-agent: |
mu4e 1.12.1; emacs 29.4 |
Hi Eli,
[Adding the mailing list again since I accidentally forgot it last
time.]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Rahguzar <rahguzar@zohomail.eu>
>> Date: Tue, 23 Jul 2024 21:22:25 +0200
>>
>> > You have the sources (in sysdep.c) of what Emacs does, so you can just
>> > look there, and then consult the various system documentation. AFAIR,
>> > the %Mem column should show the percentage of the physical RAM that
>> > the process's RSS (resident set) takes. That's what I see on 2
>> > different systems, one MS-Windows, the other GNU/Linux. On the latter
>> > I compared with 'top', and it shows the same value. So I don't think
>> > I understand why you see something different.
>>
>> Sorry for coming back to this so late. I am using a GNU/Linux but with a
>> kernal that has a 16k page size. I think that might be the problem?
>>
>> I don't understand C at all but I looked at the sysdep.c as weird math.
>> What stands out is line 3741:
>>
>> pmem = 4.0 * 100 * rss / procfs_get_total_memory ();
>>
>> The 4.0 is what makes me suspicious but it is just a hunch without any
>> understanding.
>
> Like I said: the values I see are consistent with 'top', so I think
> whoever wrote that code knew what they were doing. And note that
> values of 'rss' are multiplied by 4 everywhere they are used. I think
> the reason is clear: the RSS value is given in units of pages, and
> each page is 4KB, so to convert that into KB units, you must multiply
> by 4.
Sorry, I wasn't clear enough but I wanted to say that one my system the
each page is 16KB and not 4KB so the multiplication should be by 16 and
not 4. This is why for me the value for percentage memory shown by top
is 4 times that show by proced.