Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Dec 2011 00:03:17 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Steven Hartland <killing@multiplay.co.uk>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Invalid memory stats from vmstat and sysctl vm.vmtotal?
Message-ID:  <4EDBEE25.9050008@FreeBSD.org>
In-Reply-To: <2537A2099932494E9E7019B53EBDAA34@multiplay.co.uk>
References:  <547298A3C38F407887E1AAAAC487DF6D@multiplay.co.uk> <4ED8E9D0.4070006@FreeBSD.org> <2537A2099932494E9E7019B53EBDAA34@multiplay.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
on 02/12/2011 19:13 Steven Hartland said the following:
[snip]
> Given this starting point the following links provided me with addtional
> information:-
> http://www.freebsd.org/doc/en/books/arch-handbook/vm.html
> http://www.freebsd.org/doc/en/books/design-44bsd/overview-memory-management.html
> http://www.freebsd.org/doc/en_US.ISO8859-1/articles/vm-design/
> http://www.cse.chalmers.se/edu/course/EDA203/unix4.pdf
> 
> I was under the incorrect impression that Virtual Memory (VM) was so named as it
> was a unified physical memory and swap (virtual memory), but its not that simple,
> as other items such as file-backed objects also count to this total which would
> never show in physical or swap allocation of other tools such as top and swapinfo.
> 
> So what I believe is now the big cause of virtual memory uplift vs the memory
> totals shown by ps / top is that the vm totals include things like file backed
> memory mapped process binaries, shared libs etc many multiple times.
> 
> This would explain why this specific machine shows the applification more than
> others here as it runs thousands of very small lightweight processes.
> 
> Thanks for pointer Andy, I now understand a lot more about the BSD VMS :)
> 
> What do people think about expanding that entry in the man page of vmstat to
> clarify just what active "virtual pages" really means?

Thank you for the excellent additional research.
I think that the expanded explanation would be very appreciated, but only if it
is completely correct and unambiguous from technical perspective.  That might
not be trivial to achieve, but is realistic :-)

P.S. I think that it would also be nice to further breakdown VM stats by type of
object e.g. anonymous (swap-backed) memory vs file-backed backed memory, etc.

Proportional RSS reporting is another nice to have feature.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EDBEE25.9050008>