On Saturday 20 August 2005 05:55, Anders Johansson wrote:
On Saturday 20 August 2005 12:33, Robert Paulsen wrote:
On Saturday 20 August 2005 05:24, Hartmut Meyer wrote:
Hi,
On Saturday 20 August 2005 12:04, Shriramana Sharma wrote:
Now I know this is not a Yoper forum, but generally, what would be the procedure to detect if a swap partition was available and working?
Use the command "free". It will show you if (and how much) swap is active/used.
Or try "/sbin/swapon -s". This will also tell you the device(s) used for swap partitions and the amount of each that is in use.
Both are good ways of seeing if the kernel thinks it has swap available, but I suspect the only way to see if it's actually working (as in 'no bugs') is to actually allocate enough memory that the kernel starts swapping. A small program that does nothing but allocate memory wouldn't take many seconds to write
It's a little more complicated than you might think but luckily it's been done: wget http://weather.ou.edu/~apw/projects/stress/stress-0.18.7.tar.gz Build it as: tar zxf stress-0.18.7.tar.gz cd stress-0.18.7 ./configure make Run it as: cd src ./stress -m 1 --vm-bytes 1024M --vm-hang 5 -v Observe from a different console: sar -W 2 0 NOTE: 1024M above assumes you have at least 1 Gig of virtual memory to spare. You may want to work your way up from smaller numbers until you see swapper activity with the sar command. If you are not careful you can overrun your available virtual memory.