MemInfo(3)
π NAME π
Sys::MemInfo β query the total free and used physical memory. π
Okay so this is the MemInfo(3) page from the User Contributed Perl Documentation section, and itβs all about asking your system how much memory is doing what. π«Ά
β¨ SYNOPSIS β¨
use Sys::MemInfo qw(totalmem freemem totalswap);
print "total memory: ".(&totalmem / 1024)."\n";
print "free memory: ".(&freemem / 1024)."\n";
print "total swap: ".(&totalswap / 1024)."\n";
print "free swap: ".(Sys::MemInfo::get("freeswap") / 1024)."\n";
Like, literally copy that energy, bestie. The ampersand calls are exactly as written. π
π¦ DESCRIPTION π¦
So Sys::MemInfo returns the total amount of free and used physical memory in bytes in the totalmem and freemem variables. π
The total amount of free and user swap memory also comes back in the totalswap and freeswap variables. β¨
The vibe check has passed on these: itβs been tested on Linux 3.13.0, UnixWare 7.1.2, AIX5, OpenBSD 3.8, NetBSD 2.0.2, FreBSD 5.4, HPUX11, Solaris 9, Tru64 5.1, Irix 6.5, Mac OS X 10.2 darwin and Windows XP. π§ͺπΈ
It should work on FreeBSD 4 and Windows 9X/ME/NT/200X/Vista. Fingers crossed, bestie. π€π
π§ METHODS π§
π availkeys
Returns a list of all accessor keys (freemem, totalmem, etc.). This is useful for dumping out all known information from the object by calling get() on all of the returned keys. ποΈβ¨
π freemem
Returns free physical memory in bytes. πΎ
π¦ freeswap
Returns free swap space in bytes. πΈ
π get
Returns the value of the passed key. π
π totalmem
Returns total physical memory size in bytes. π
β totalswap
Returns total swap space in bytes. β¨
π AUTHOR π
By Sylvain Cresto <scresto@gmail.com> π«Ά
Thanks to Laurent Dufour and Wilson Snyder. You guys ate. π
π BUGS π
Please send bug-reports to scresto@gmail.com β donβt be shy, bestie. π¬π
π LICENCE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πβ¨
π COPYRIGHT π
Copyright (C) 2005, 2006, 2014, 2016 - Sylvain Cresto π
mwah π this page is from perl v5.42.0, dated 2020-11-24 β bye bestie! π¦β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Sys-MemInfo 0.99-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Sys-MemInfo 0.99-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Sys-MemInfo 0.99-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Sys-MemInfo 0.99-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms