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


Click here to return to the 'Tweak dynamic_pager to make better use of small swap partitions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Tweak dynamic_pager to make better use of small swap partitions
Authored by: adrinux on Jun 21, '05 03:37:05PM

I can confirm this hint works on my G4 with the swap partition on the original 60Gb drive and my 160Gb as the boot partition. (That said be careful about cutting and pasting the rc.txt contents from the tip, using BBEdit I ended up with a bad character that killed /bin/sh and brought startup to a halt - Terminal.app on the Tiger install DVD comes in handy :).

But one other thing I was doing in Panther was changing the dynamic_pager settings to more closely match those in Jaguar. If you've moved swap to a different partition that's relatively small, or even if you've not moved swap at all and just have a small amount of space on your main drive changing the pager settings may help dynamic_pager to make better use of the available space.

By default dynamic_pager in Panther and Tiger creates swapfiles in exponentially larger sizes. The first is 64Mb, the second 64Mb, the third 128Mb, then 256Mb, 512Mb, 1Gb, 2Gb etc. So if your swap partition is 3Gb and you've already got to the stage of having 2Gb of swapfiles dynamic_pager will try to create the 2Gb swapfile and fail because there is only 1 Gb left - clearly ridiculous, especially if only a few more Mb of swap space are needed.

What you can do is tell dynamic_pager to use fixed size swap files. Here's what I did after applying the hint above. Find the line (265 in my rc after moving swap) in /etc/rc that says:

/sbin/dynamic_pager ${encryptswap} -F ${swapdir}/swapfile

and comment it out then add a new line:

/sbin/dynamic_pager ${encryptswap} -H 40000000 -L 320000000 -S 256000000 -F ${swapdir}/swapfile

This will cause dynamic_pager to create swapfiles of 256Mb in size, larger than the 80Mb used in Jaguar, but not too big. You can of course use different numbers but please read

man dynamic_pager
first! The relative size of these three numbers is very important!



[ Reply to This | # ]
Tweak dynamic_pager to make better use of small swap partitions
Authored by: adrinux on Jun 21, '05 03:58:33PM
Ok, so this creates 244Mb swapfiles :)

It's one of those bits vs bytes things isn't it?



[ Reply to This | # ]