Background
When my MacBookPro5,2 with 8 GB memory boots in safe mode I see that the operating system causes dynamic_pager(8) to create swap files in a way that's relatively unrestrained. In the file system that I dedicate to swap, siblings of
/Volumes/swap/swapfile0
are created very quickly. Simple use of an app seems to result in more swap files than comparable use of that app with a normal boot.
Performance with safe boot – with a greater than normal mass of external swap files – is remarkably good. So I'd like to experiment with:
- an equally unrestrained approach to swap files with a normal boot.
Question
How can I make the operating system behave in a way that causes a greater than normal mass of swapfiles to be created by dynamic_pager
?
I'm prepared to accept the risks that may be associated with evil tuning.
Related
Why might more memory be wired in safe mode than in normal mode?
Answers there may help towards answers here.
Preliminary investigation
I ran sysctl -a
in normal mode and safe mode. I see differences but (unless I'm missing something) nothing to explain the freedom that's associated with a safe boot.
https://apple.stackexchange.com/a/72732/8546 by @Quantumpanda is thought-provoking but the question there is, in a way, the opposite of what I want.
In Server Fault, FreeBSD performance tuning. Sysctls, loader.conf, kernel is popular but much of that seems network-oriented.
First experiments
The essence of this question was originally:
- How can I get
dynamic_pager
to behave with a normal boot as it behaves with a safe boot?
– and so I experimented with values for -S
and -H
.
dynamic_pager option -S
In 2003, when -H
and -L
were hire_point
and layoff_point
, the default file_size
was 20000000 Mac OS X in a nutshell, page 595). For more recent versions of the operating system, some users prefer a filesize
that's around fifty times greater, 1.07 GB on disk:
- 1073741824
dynamic_pager option -H
With and without a value for -S
, I experimented with various high-water-trigger
values, including the one suggested by dynamicpagerwrapper:
- 209715200
None had the required effect.
References
Addressing The Outmoded Swapping And Paging Strategy in OSX? | dropsafe (2010-03-01, updated in 2012)
dynamic_pager_wrapper source from dynamicpagerwrapper – performance wrapper for /sbin/dynamic_pager on OSX
In the Mac Developer Library: