memory reported in /proc/pid/status is wrongly scaled

Corinna Vinschen
Tue Aug 21 20:20:00 GMT 2018

On Aug 21 16:53, Livio Bertacco wrote:
> Thanks Corinna, I tried the developer snapshot and the VmSize line from
> "status" file looks good now.
> What do you think about adding the VmPeak line too? (I can create the patch
> myself).
> >  On second thought there's more wrong than just that.
> > Just dividing by page_size or allocation_granularity results in too small
> values.
> Yes, now that you mention it, this rounding up is actually still missing
> for the vmrss and vmmaxrss values in the "stat" file (which just divides by
> page_size):
> 1150
> <;a=blob;f=winsup/cygwin/>
> vmrss = vmc.WorkingSetSize / page_size;
> 1151
> <;a=blob;f=winsup/cygwin/>
> vmmaxrss = ql.MaximumWorkingSetSize / page_size;
> and, by the way, is it correct that these two are reported in 4k pages
> instead of 64k pages?
> "statm" reports e.g. VmRss (that's the second value in the statm line) in
> 64k pages so that value doesn't match the same Rss amount (24th value) from
> "stat".

I'd actually be happy to get patches here.  Just have a look at for the 2-clause BSD statement.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the Cygwin mailing list