Test2:...emUsage(3pm)
π Test2:...emUsage β like, the manual page bestie π
okay so this is Test2::Plugin::MemUsage(3pm) from the User Contributed Perl Documentation, and I'm gonna walk you through it like we're texting at 2am. grab a snack. π
β¨ NAME β¨
Test2::Plugin::MemUsage β Collect and display memory usage information. that's it, that's the whole vibe. π
π PLATFORM SUPPORT π
so the plugin is lowkey an overachiever and it picks a memory collector based on $^O. different platforms, different strategies, no cap:
- Linux, Cygwin, GNU/kFreeBSD β it reads
/proc/PID/status. it reportsrss,size(VmSize), andpeak(VmPeak). three for three, slay. π - macOS (darwin), *BSD, Solaris, AIX, HP-UX β it shells out to
ps -o rss=,vsz= -p $$. it reportsrssandsize;peakis NA unlessBSD::Resourceis installed (see below bestie, I gotchu). π - MSWin32 β it uses
Win32::Process::Memoryif installed to callGetProcessMemoryInfo. it reportsrss(WorkingSetSize),peak(PeakWorkingSetSize), andsize(PagefileUsage). Windows eating good. πͺβ¨ - Other / fallback β if
BSD::Resourceis installed,getrusageis used to fill in apeakRSS value when the primary collector did not provide one (or when no native collector matched the platform at all). it's giving backup dancer energy. πΊ
and if no collector and no fallback applies? the plugin is a silent no-op. literally says nothing. ghosted you fr fr. π
π¦ DESCRIPTION π¦
This plugin will collect memory usage info from /proc/PID/status and display it for you when the test is done running. that's the whole thing. it just vibe-checks your memory and reports back like a good little bestie. π«Ά
π SYNOPSIS π
use Test2::Plugin::MemUsage;
This is also useful at the command line for 1-time use:
$ perl -MTest2::Plugin::MemUsage path/to/test.t
Output:
# rss: 36708kB
# size: 49836kB
# peak: 49836kB
okay but the output is so clean?? rss, size, peak, all lined up. main character formatting honestly. π₯
πΈ SOURCE πΈ
The source code repository for Test2-Plugin-MemUsage can be found at https://github.com/Test-More/Test2-Plugin-MemUsage/. go lurk, it's fine, we all do it. π
π MAINTAINERS π
- Chad Granum <exodist@cpan.org>
β AUTHORS β
- Chad Granum <exodist@cpan.org>
(yes bestie, the maintainer and the author are the same icon. king behavior.) π
π COPYRIGHT π
Copyright 2019 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
no cap, that's the entire page. every flag-ish thing, every path, every platform, every name β all accounted for. nothing skipped, nothing invented. periodt. π
and that's the tea, bestie β this was perl v5.40.1, dated 2026-05-06, and I hope your memory usage stays iconic forever. mwah. πβ¨π¦π
π¦ where this page comes from
- ubuntu stonking: libtest2-plugin-memusage-perl 0.002006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms