[Nautilus-list] Re: Tiny patch

ml micampe it (2002-04-08 at 1803.11 +0200):
> > If someone knows the "correct" way to get this figure, i.e. Not a
> > guesstimation, then I'll gladly give it a go.
>   I'm totally clueless on the subject, but what about using the size of
> /proc/kcore?
>   mem = size(/proc/kcore) / 1024**2

Somewhere I read that kcore is RAM plus some KB (or maybe minus, the
doc could be out of date, cos .c file is not so direct). That is more
accurate, all the other calcs seems to be based in the RAM avaliable
for the user processes, not taking into account kernel mem, while user
will probably want to know if the silicon he bought is working OK.

Experimentaly ( size(/proc/kcore) + 512<<10 ) >>20 gives the nominal
MB in machines I checked (the 512<<10 is half MB, to perform rounding
-.5 .. .5 MB instead of floor style). Those with more knownledge
should check get_kcore_size function in fs/proc/kcore.c to get a
better formula.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]