Real and Free Memory

Marc Olzheim marcolz at stack.nl
Wed Jul 20 09:18:02 GMT 2005


On Wed, Jul 20, 2005 at 10:56:58AM +0200, Marc Olzheim wrote:
> On Wed, Jul 20, 2005 at 11:42:57AM +0300, zkan KIRIK wrote:
> > Hi,
> > 
> > i am trying to measure free memory and real memory.
> > 
> > but values at dmesg.boot and sysctl  are diffrent.
> > 
> > # cat /var/run/dmesg.boot | grep real
> > real memory  = 268435456 (256 MB)
> > 
> > # sysctl vm.vmtotal  | grep Real
> > Real Memory:            (Total: 232792K Active 122448K)
> > 
> > As above, values are not equal,
> > so that, i cant trust the Free Memory value that sysctl gives.
> > 
> > how can i get right values?
> 
> sysctl hw.physmem

Let me be a bit more precise:

sysctl vm.stats.vm will show you all the memory info you need in the vm
system, as in: pageable memory. It's shown in number of pages (usually
4K: vm.stats.vm.v_page_size).

Keep in mind that 'free' memory depends on the way you look at it. Pages
that contain still caching synced-on-disk data (inactive pages) can be
considered 'free' as well as any 'free' page.

See

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#TOP-MEMORY-STATES

Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050720/c3ac909f/attachment.bin


More information about the freebsd-hackers mailing list