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
.
The PID to obtain stats for. If omitted, it uses the current PID from
$$
.
The page size.
The raw array reference of values.
Total program size, in pages.
An alias for "size".
Resident set size (RSS), in pages.
An alias for "resident".
Shared pages.
Text (code).
Library (unused in Linux 2.6).
Data + Stack.
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
.
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
.
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".
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;
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.