.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MemInfo 3" .TH MemInfo 3 2023-07-26 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Sys::MemInfo \- query the total free and used physical memory .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Sys::MemInfo qw(totalmem freemem totalswap); \& \& print "total memory: ".(&totalmem / 1024)."\en"; \& print "free memory: ".(&freemem / 1024)."\en"; \& \& print "total swap: ".(&totalswap / 1024)."\en"; \& print "free swap: ".(Sys::MemInfo::get("freeswap") / 1024)."\en"; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Sys::MemInfo return the total amount of free and used physical memory in bytes in totalmem and freemem variables. .PP Total amount of free and user swap memory are alse returned in totalswap and freeswap variables. .PP This module has 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. .PP It should work on FreeBSD 4 and Windows 9X/ME/NT/200X/Vista. .SH METHODS .IX Header "METHODS" .IP availkeys 4 .IX Item "availkeys" Return list of all accessor keys (freemem, totalmem, etc.) This is useful for dumping out all known information from the object by calling \fBget()\fR on all of the returned keys. .IP freemem 4 .IX Item "freemem" Returns free physical memory in bytes. .IP freeswap 4 .IX Item "freeswap" Returns free swap space in bytes. .IP get 4 .IX Item "get" Returns the value of the passed key. .IP totalmem 4 .IX Item "totalmem" Returns total physical memory size in bytes. .IP totalswap 4 .IX Item "totalswap" Returns total swap space in bytes. .SH AUTHOR .IX Header "AUTHOR" Sylvain Cresto .PP Thanks to Laurent Dufour and Wilson Snyder. .SH BUGS .IX Header "BUGS" Please send bug-reports to scresto@gmail.com .SH LICENCE .IX Header "LICENCE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2005, 2006, 2014, 2016 \- Sylvain Cresto