Re: Inconsistancies in /proc (status vs statm) leading to wrong documentation (proc.txt)

Albert Cahalan
2004-10-09T13:55:12Z

Eric Valette writes:

> I'm currently trying use mlockall for a soft RT application and was
> concerned by the memory usage of my (big) RT process. So I stated to
> look at /proc/<PID>/status and /proc/<PID>/statm and then to the
> documentation of statm (Documentation/filesystem/proc.txt) because
> unexplained values are rather useless.
>
> The doc currently says :
> -------------------------------------------------------------------------
> Field Content
> size total program size (pages) (same as VmSize in status)

The documentation is incorrect. It was written to match a buggy
implementation in early 2.6.x kernels.

VmSize is the address space occupied, excluding memory-mapped IO.
The statm value is the address space occupied.

> May I suggest :
> - To use consistent memory size units between status and statm,

No way. This would instantly break the "top" program.