Linux::Statm::Tiny - simple access to Linux /proc/../statm
version 0.0700
use Linux::Statm::Tiny; my $stats = Linux::Statm::Tiny->new( pid => $$ ); my $size = $stats->size;
This class returns the Linux memory stats from /proc/$pid/statm.
pid
The PID to obtain stats for. If omitted, it uses the current PID from $$.
$$
page_size
The page size.
statm
The raw array reference of values.
size
Total program size, in pages.
vsz
An alias for "size".
resident
Resident set size (RSS), in pages.
rss
An alias for "resident".
share
Shared pages.
text
Text (code).
lib
Library (unused in Linux 2.6).
data
Data + Stack.
dt
Dirty pages (unused in Linux 2.6).
You can append the "_pages" suffix to attributes to make it explicit that the return value is in pages, e.g. vsz_pages.
vsz_pages
You can also use the "_bytes", "_kb" or "_mb" suffixes to get the values in bytes, kilobytes or megabytes, e.g. size_bytes, size_kb and size_mb.
size_bytes
size_kb
size_mb
The fractional kilobyte and megabyte sizes will be rounded up, e.g. if the "size" is 1.04 MB, then size_mb will return "2".
refresh
The values do not change dynamically. If you need to refresh the values, then you you must either create a new instance of the object, or use the refresh method:
$stats->refresh;
proc(5).
The development version is on github at https://github.com/robrwo/Linux-Statm-Tiny and may be cloned from git://github.com/robrwo/Linux-Statm-Tiny.git
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Linux-Statm-Tiny/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Robert Rothenberg <rrwo@cpan.org>
Adrian Lai <aidy@cpan.org>
James Raspass <jraspass@gmail.com>
Karen Etheridge <ether@cpan.org>
Mohammad S Anwar <mohammad.anwar@yahoo.com>
Toby Inkster <github@toby.ink>
This software is copyright (c) 2015-2022 by Thermeon Worldwide, PLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Linux::Statm::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Statm::Tiny
CPAN shell
perl -MCPAN -e shell install Linux::Statm::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.