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 +; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."