Unix::S...m_stats(3)
β¨ NAME β¨
okay so bestie, gather round π this page is Unix::Statgrab::sg_mem_stats β it's a Perl package that's literally just a lil container for the memory stats that libstatgrab hands over. think of it as the cute lil box where your RAM numbers live. it comes from the User Contributed Perl Documentation corner of the manual-verse, and its manual name is Unix::S...m_stats(3) (yes the title is abbreviated, no that's not a typo, that's just how the man page wears its name π).
πΈ DESCRIPTION πΈ
Unix::Statgrab::sg_mem_stats is a Perl package name that gives you accessors into the bundled libstatgrab sg_mem_stats memory statistics π§ (the original docs for that live over at <http://www.i-scream.org/libstatgrab/docs/sg_get_mem_stats.3.html> β go peek if you want the deep lore, iykyk).
basically: libstatgrab collects the memory tea, and this package is the main character that lets you actually read it. π
π METHODS π
π¦ nentries
Returns the number of entries in the container. that's it. that's the whole vibe. how many lil guys are in the box.
π¦ systime
Returns the seconds since Epoch β that's 0:00:00 on January, 1st 1970 for the uninitiated β of the time the memory statistics were measured. so it's giving "when did you take this photo" energy for your memory numbers πΈ.
π¦ as_list
Deprecated alias of fetchall_hash. it's the old name, it still works, but it's lowkey retired. use the new one, bestie. π
π¦ fetchall_hash
Returns all records from the sg_mem_stats container as a list of hashes, where each datum name is the key and the datum is the value. so you get the names and the numbers, all cozy together π«Ά.
π¦ fetchall_array
Returns all records from the sg_mem_stats container as a list of arrays, with the values in this exact order:
(total free used cache systime)
in that order, without a leading headline. no header row, just straight into the data. periodt.
π¦ fetchall_table
Returns all records from the sg_mem_stats container as a list of arrays, values in this exact order:
(total free used cache systime)
in that order, including the leading headline. so this one does come with the header row β it's the one that shows up dressed for the occasion β¨.
π¦ fetchrow_arrayref($row = 0)
Returns one row as an array, with the values in the same order as above. defaults to row 0 if you don't say which row you want, so if you're lazy it just gives you the first one π.
π¦ fetchall_arrayref
Returns all records from the sg_mem_stats container as an array of arrays, without a header. all the data, none of the labels.
π¦ fetchrow_hashref($row = 0)
Returns one row as a hash, shaped like { total => $self.total($row), free => ... }. defaults to row 0, same deal as its arrayref sibling. name-value pairs, chef's kiss π.
π¦ fetchall_hashref
Returns all records from the sg_mem_stats container as an array of hashes. every row gets its own lil hash, all lined up in an array. slay.
π¦ colnames
Returns the list of column names: (total free used cache systime). the whole squad, in order, name by name.
π¦ total
The total amount of real memory in bytes. the whole entire plate π.
π¦ free
The free amount of real memory in bytes. the part that's just sitting there, unbothered, available.
π¦ used
The used amount of real memory in bytes. the part that's already clocked in and working.
π¦ cache
The amount of real memory in bytes used for caching. the part holding onto stuff just in case, main character energy fr fr.
π AUTHOR π
Jens Rehsack, <rehsack AT cpan.org> β shoutout to the icon who built this π«Ά
π COPYRIGHT AND LICENSE π
Copyright (C) 2012-2018 by Jens Rehsack
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
okay so real talk, that license bit matters β it's LGPL, version 2.1 or (at your option) any later version, and yes you can redistribute and/or modify it under those terms. read it properly, don't just skim, bestie. π
and that's the whole page, babes β¨ this was Unix::S...m_stats(3) from perl v5.42.0, dated 2025-07-25 β stay hydrated, stay cached, and go read your memory stats ππ¦π
π¦ where this page comes from
- fedora 43: perl-Unix-Statgrab 0.112-27.fc43 Β· (LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl))
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms