Is there a program equivalent to swapinfo for Rasbian? I'm using a Pi3 with the latest version of Rasbian. The machine is configured to use dphys-swapfile, I've added a USB flash swap drive and I'd like to see the effect of adding a second USB flash drive. It's hard to understand what's going on without some utility to compare usage.
I've tried using apt-get install swapinfo, but it's not found. Is there something lurking under a different name?
The htop utility can show swap usage in text or a bar graph. apt-get install htop # I think
Active swap I/O can be observed with vmstat, si=swap in, so=swap out.
$ vmstat 1 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 2 0 78356 35572 7312 828852 0 0 3 1 5 2 1 1 94 4 0 0 0 78356 35548 7312 828868 0 0 0 0 585 310 2 0 98 0 0 0 0 78356 35516 7312 828868 0 0 0 0 603 304 4 0 96 0 0 ^C
$ vmstat -s 949580 K total memory 77908 K used memory 416096 K active memory 439448 K inactive memory 31540 K free memory 7304 K buffer memory 832828 K swap cache 1048572 K total swap 78356 K used swap 970216 K free swap 11641959 non-nice user cpu ticks 1224944 nice user cpu ticks 5878433 system cpu ticks 850078619 idle cpu ticks 36563871 IO-wait cpu ticks 0 IRQ cpu ticks 1979324 softirq cpu ticks 0 stolen cpu ticks 1019055220 pages paged in 784013486 pages paged out 33886 pages swapped in 100472 pages swapped out 2317299646 interrupts 1395971095 CPU context switches 1517672408 boot time 1935316 forks
If you just want to see whether anything is using swap space, use 'top'. Its a standard part of every Raspbian install.
In addition, if a long running program is using swap, top will show you enough detail to pick which one it is: any program whose memory quota approaches or exceeds the installed RAM size is likely to be the culprit.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.