sub mem{ `ps -o rss $$` =~ m[(\d+)] } #### sub mem { local $/; open my $fh, '/proc/self/status'; <$fh> =~ /^VmRSS:\s*(\d+)/m; }