Assuming you're on Linux, you might consider Linux::MemInfo
#!/usr/bin/perl -w use strict; use Linux::MemInfo; my %meminfo = get_mem_info(); my $total = $meminfo{'MemTotal'}; my $free = $meminfo{'MemFree'}; my $buffers = $meminfo{'Buffers'}; my $cached = $meminfo{'Cached'}; my $really_free = $free + $buffers + $cached; my $percent_free = int(100 * $really_free / $total); print <<"EOM"; Total: $total Free: $really_free ($percent_free%) EOM
If you're not on Linux, you might consider sharing what OS you are using.
-- Eric Hammond
In reply to Re: Remaining Memory on a system
by esh
in thread Remaining Memory on a system
by smellysocks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |