It seems that sometimes, my computer will start swapping unnecessarily (memory usuage is ~25%), and I can't figure out why.

It seems to happen most often when running Perl scripts, but these aren't intensive scripts, and I can't find any thing saying that Perl can only see a certain amount of memory. The swap usage persists after the scripts finish, and even after closing Firefox, Banshee, etc. Restarting X will sometimes solve the problem, but other times, a full restart is required.

This becomes a big problem for me because as soon as whatever-it-is starts swapping, everything else seems to as well. Basic things like closing program or switching viewpoints take longer and longer. If left unchecked, this swap usage will eventually force my computer into indefinite thrashing, unable to even respond to keystrokes!

1 Answer
1

Setting your swappiness to a "lower number" may reduce the "frequency" of using swap, but setting it to 0 will force the kernel down a different code path, forcing all memory allocation to first use up all available memory and cache before using swap space.