#!perl use strict; use warnings; my $memory_eaten = 8 * 1024 * 1024 * 1024; # 8GB, adjust to fit my %memory_eater = ( foo => scalar( " " x $memory_eaten ), ); my $cmd = "foo bar"; system($cmd) == 0 or die "Couldn't launch '$cmd': $!/$?";