Unix::S...m_stats(3)

πŸ“¦ version 0.112, in fedora 43

✨ 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 (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