Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the Virtual Memory



On 9/6/06 01:17, Jordan K. Hubbard wrote:
You might look at the source code for top(1) - it grubs through a lot of this information.


Thanks Jordan, I actually did use top (and vm_stat) to work out how to get the vm statistics and report on the real memory usage. At the time I couldn't see what I wanted for swap usage, but I'll look again now that I've read more (the virtual memory chapter in "Mach 3 Kernel Principles" by Loepere/OSF is helping quite a lot).


To me, it looks like there's no way to produce output equivalent to the analogous program on Linux[*], which (abridged) produces this:
             total       used       free     shared    buffers     cached
Swap:      2000084          0    2000084
because their VMM uses static files/partitions of fixed size and then just works until they're full (or you swapon(2) another), whereas the Darwin VMM is dynamically growing (and, if the moon is in the third house and a two-headed calf has been born, plus some nonsense about low water marks and filesizes, shrinking) its usage on the filesystem, so in principle there's no "total" swap availability, modulo hard drive space...

...which leads me to answer a question from my original post; is there a way to get xnu to start swapping on a new partition? The answer seems to be to use /sbin/dynamic_pager (from system_cmds), however there's still no way to report on what external paging files are currently in use nor to disable one (so if you do go load-balancing your swapspace across multiple disks, you'd better remember not to forcibly unmount any of them). That would potentially be useful <sfx:reads some more, cracks open Xcode>.

Cheers,

Graham.

[*]which would probably explain why I didn't do that before.  :-)
--
Graham Lee
UNIX Systems Manager,
Oxford Physics Practical Course
http://iamleeg.blogspot.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >the Virtual Memory (From: Graham J Lee <email@hidden>)
 >Re: the Virtual Memory (From: "Jordan K. Hubbard" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.