Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Tuning dynamic_pager so unused swapfiles dissapear' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Tuning dynamic_pager so unused swapfiles dissapear
Authored by: carsten on Jul 19, '03 09:18:54AM

Nice tip! I couldn't get the script to work, I get

I have 768 Mb RAM, and my vnodesused=13101, vnodesmax=13104. As soon as I increased kern.maxvnodes=51904 the system started using it, already at 13431 vnodes used in only a couple minutes of running.

Well Mac OS X doesn't use sysctl for virtual memory so the sysctl entries: vm.{anon,exec,file}{min,max} (referenced in a link to an email in the page referenced above).

I made the following changes to my /etc/rc file:


dynamic_pager -H 35000000 -L 80000000 -S 40000000 -F ${swapdir}/swapfile

In case you want to go back, the original statement was:


dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile

For a while I tried cutting the swap file sizes in half, because the swapfiles never EVER seemed to dissapear from my /var/vm, however it did not seem to make any difference at all:


dynamic_pager -H 20000000 -L 80000000 -S 40000000 -F ${swapdir}/swapfile

By lowering the "highwater mark" to 35000000 from 40000000, now my swapfiles are disappearing once in a while. Most noticeably when I run classic, look in /private/var/vm, then stop Classic. Look in /private/var/vm again. Tada!

Note that Apple's dynamic_pager is very poorly documented and I just got lucky with my choice of numbers. Being a crucial component of the OS, dynamic_pager really needs some comprehensive documentation!

[ Reply to This | # ]