in reply to Swap hog - I do not understand this behavoir
Could it be that you just didn't wait long enough?
Spawning two processes (swapon & tail), each time around in your inner loop is going to slow thing down 100 or maybe 1000 fold.
Try modifying your loop to only spawn the processes much less frequently and it'll probably move into swaping much more quickly:
my $count = 0; while ( 1 ) { chomp( $swapon ); print FH "[$swapon $count]\n"; push @blackhole, "$count ----------------------------- +---------- +--------------------------------\n"; $count++; $swapon = `swapon -s | tail -1` unless ++$count % 1000 +; }
|
|---|