Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a CPAN Perl module to find total/used/free memory on a host (without running command line through a system() call)?

Is there a CPAN Perl module which provides total/used/free memory (like vmstat does) on a host without running a command line through a system() call to get the info?

Ideally it should be cross-platform (Linux and Solaris) though please provide Linux or Solaris-only ones as well.

like image 358
DVK Avatar asked Aug 09 '11 14:08

DVK


2 Answers

Looks like Sys::MemInfo is what I needed.

It is implemented in XS, using <sys/sysinfo.h> for Linux and <sys/stat.h> / <sys/swap.h> for Solaris.

like image 51
DVK Avatar answered Oct 16 '22 08:10

DVK


Try the Sys::Statistics::Linux distrubition for linux.

like image 40
J-16 SDiZ Avatar answered Oct 16 '22 09:10

J-16 SDiZ