This is fast and dirty and, above all, the CPAN method. It works on any OS that provides the / proc file system, that is, derivatives of Linux and Unix, including Mac OS X, as well as Cygwin for Windows:
perl -e 'print qx{ grep VmSize /proc/$$/status };'
Perleone
source share