NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "adjusting" / control Swapping



Hi, I think if you have daemons that allocate unbounded amount of memory, 
there is not much you can do to avoid swapping, short of killing the offending 
daemons.

Look at 'sysctl -d | grep vm' for description of virtual memory parameters. I 
don't think sysctl paramerts can totally avoid swapping, but they can make the 
operating system use memory more efficiently.

For example on my desktop machine I have the following settings. I set cache 
file to 5%  because this machine is not a file server, so I don't care about 
caching loads of files. I also tell system to reserve a minimum of 60% and if 
it needs more to allocate up to 90% of physical memory for application 
anonymous data, because I run many desktop applications like KDE, Firefox, 
OpenOffice, etc. and they use a lot of anonymous memory.


# First reset everything to minimum
vm.anonmin=1                                                                   
vm.anonmax=1                                                                   
vm.filemin=1                                                                   
vm.filemax=1                                                                   
vm.execmin=1                                                                   
vm.execmax=1                                                                   

# Now set min. and max. limits
vm.anonmin=60
vm.anonmax=90                                                                  
vm.filemin=5                                                                   
vm.filemax=5                                                                   
vm.execmin=20                                                                  
vm.execmax=60


Home | Main Index | Thread Index | Old Index