I\'m working on a small function, that gives my users a picture of how occupied the CPU is.
I\'m using cat /proc/loadavg, which returns the well known 3 num
cat /proc/loadavg
The simplest way I have found to load the RAM (and SWAP) is by using Perl:
my $allocation = "A" x (1024 * 1024 * $ARGV[0]); print "\nAllocated " . length($allocation) . "\n";