.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 3pm" .TH MemInfo 3pm "2018-11-01" "perl v5.28.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, \s-1AIX5,\s0 OpenBSD 3.8, NetBSD 2.0.2, FreBSD 5.4, \s-1HPUX11,\s0 Solaris 9, Tru64 5.1, Irix 6.5, Mac \s-1OS X 10.2\s0 darwin and Windows \s-1XP.\s0 .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