Controlling swap usage and buffer levels

Hello again,

I have noticed that FreeBSD starts using swap relatively fast and keeps quite a lot of memory in the buffers. According to tuning(7)(), one is able to control some of these parameters with sysctl(8)(), but I don't think this utility offers enough control.

Is there a way I can decrease the level of buffers or even flush them? And also, can I control the "swappiness" of my operating system? I want for example start committing to swap when I only have 4 MB of free RAM left.

Thank you for your time,

Jože
 
Swapping can be a good thing. For example if you have a service running that doesn't do any real work except for a short time at times that can't be predicted in advance because the service wakes up in response to some external trigger. You certainly don't want the code and data of that service to be in memory all the time but to be swapped out until the service wakes up to do what it's supposed to do.
 
I am not against swapping, but what concerns me is if swapping occurs too early.

If I have to diagonalize a large matrix for example, I noticed that swapping occurs too early, when there is still usable space left in RAM. I don't really know which programs are being transferred there, but I want that numerical program to use as much RAM as possible (so to prioritize it).
 
Active processes that have pages in memory with usage timestamps not too old will never be swapped out unless there's a real shortage of memory.
 
Back
Top