1Sys::Statistics::Linux:U:sMeermSCtoanttsr(i3b)uted PerlSDyosc:u:mSetnattaitsitoincs::Linux::MemStats(3)
2
3
4
6 Sys::Statistics::Linux::MemStats - Collect linux memory information.
7
9 use Sys::Statistics::Linux::MemStats;
10
11 my $lxs = Sys::Statistics::Linux::MemStats->new;
12 my $stat = $lxs->get;
13
15 Sys::Statistics::Linux::MemStats gathers memory statistics from the
16 virtual /proc filesystem (procfs).
17
18 For more information read the documentation of the front-end module
19 Sys::Statistics::Linux.
20
22 Generated by /proc/meminfo.
23
24 memused - Total size of used memory in kilobytes.
25 memfree - Total size of free memory in kilobytes.
26 memusedper - Total size of used memory in percent.
27 memtotal - Total size of memory in kilobytes.
28 buffers - Total size of buffers used from memory in kilobytes.
29 cached - Total size of cached memory in kilobytes.
30 realfree - Total size of memory is real free (memfree + buffers + cached).
31 realfreeper - Total size of memory is real free in percent of total memory.
32 swapused - Total size of swap space is used is kilobytes.
33 swapfree - Total size of swap space is free in kilobytes.
34 swapusedper - Total size of swap space is used in percent.
35 swaptotal - Total size of swap space in kilobytes.
36 swapcached - Memory that once was swapped out, is swapped back in but still also is in the swapfile.
37 active - Memory that has been used more recently and usually not reclaimed unless absolutely necessary.
38 inactive - Memory which has been less recently used and is more eligible to be reclaimed for other purposes.
39 On earlier kernels (2.4) Inact_dirty + Inact_laundry + Inact_clean.
40
41 The following statistics are only available by kernels from 2.6.
42
43 slab - Total size of memory in kilobytes that used by kernel for data structure allocations.
44 dirty - Total size of memory pages in kilobytes that waits to be written back to disk.
45 mapped - Total size of memory in kilbytes that is mapped by devices or libraries with mmap.
46 writeback - Total size of memory that was written back to disk.
47 committed_as - The amount of memory presently allocated on the system.
48
49 The following statistic is only available by kernels from 2.6.9.
50
51 commitlimit - Total amount of memory currently available to be allocated on the system.
52
54 new()
55 Call "new()" to create a new object.
56
57 my $lxs = Sys::Statistics::Linux::MemStats->new;
58
59 It's possible to set the path to the proc filesystem.
60
61 Sys::Statistics::Linux::MemStats->new(
62 files => {
63 # This is the default
64 path => '/proc',
65 meminfo => 'meminfo',
66 }
67 );
68
69 get()
70 Call "get()" to get the statistics. "get()" returns the statistics as a
71 hash reference.
72
73 my $stat = $lxs->get;
74
76 No exports.
77
79 proc(5)
80
82 Please report all bugs to <jschulz.cpan(at)bloonix.de>.
83
85 Jonny Schulz <jschulz.cpan(at)bloonix.de>.
86
88 Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
89
90 This program is free software; you can redistribute it and/or modify it
91 under the same terms as Perl itself.
92
93
94
95perl v5.32.1 2021-01-27Sys::Statistics::Linux::MemStats(3)