Redouane Boumghar wrote: > Hello all, > > Grant wrote: >> Also, I've noticed in top that when my server's 2GB of memory is >> filled, it uses a small amount of swap (~24k) before it frees some up. >> The "Swap: 24k" then remains. Is that normal? > > Yes I have also notice that after a heavy ram use I get this tiny > space used on my swap. And it remains even after my ram has been half > freed. > My box has 1GB of ram and the small amount I sometime get on swap is > 164KB and it can stay like that for 2 weeks, until i reboot. > But I assume rebooting is not a great solution for a server :=) > > Writing to disk is too expensive as Pablo Antonio suggested, so once swap > has been used it won't be cleaned until next use, but how to be sure > it is cleaned at next use ?
>From /etc/conf.d/rc: > # RC_SWAP_ERASE controls erasing of swap partitions at shutdown. > # Useful for all those paranoid peeps to nuke their memory. > > RC_SWAP_ERASE="yes" > > Anyway if you want to have stats on the usage of your memory you can > use 'free' > but for a long-period log I would recommend 'vmstat' as it puts > everything on one line so you could gnuplot it later. > > vmstat | grep -v [a-z] >> memory.log > > > As Daniel Iliev suggested, there is the configurable sysctl for swap > control solutions. The variables vm.swappiness and the > vm.swap_token_timeout which > control the "trashing behavior". I didn't really find much info on > vm.swap_token_timeout. > > The man is not very extensive. > Has Anyone more info on configuration of the file /etc/sysctl.conf ? > especially for : > vm.swappiness > vm.swap_token_timeout You can put this in your /etc/sysctl.conf file: > vm.swappiness = 30 That is what I have in mine. It does work though. I have changed and you can see the difference. > > If we get a solution or just some more info, > it would be nice to have a wiki page about it, wouldn't it ? ;) > > Have a Good Day, > Red. > > ----------------------------------------+ > MAGELLIUM @ http://www.magellium.fr/ > ----------------------------------------+ > -- gentoo-user@gentoo.org mailing list