Changes for version 0.002004 - 2026-04-25
- Fix broken grep filter in send_mem_event that referenced @_ of the outer sub instead of the grep iterator
- Match \s+ instead of a literal space between value and unit in the Vm* regexes
- Warn instead of die when opening or closing the procfile fails, so the exit callback does not abort the test process
- Use -e instead of -f when checking for the procfile, so non-Linux procfs implementations are not rejected
- Add raw numeric value and units to harness_job_fields entries under a 'data' hash so consumers can sort and aggregate without reparsing the display string
- Refactor memory collection into a $^O-keyed dispatcher with a reusable _collect_proc backend (no behavior change on Linux)
- Add darwin and *BSD support via 'ps -o rss=,vsz= -p $$' (peak remains NA there unless BSD::Resource is available)
- Add MSWin32 support via Win32::Process::Memory (recommended, not required) and recommend it in dist.ini
- Add BSD::Resource getrusage(RUSAGE_SELF) fallback that fills peak RSS when the primary collector did not provide one and acts as a last-resort collector on platforms with no native backend; recommend BSD::Resource in dist.ini. Also document the platform support matrix in POD
- Add t/dispatch.t covering _collector_for_os table, _augment_peak fill / preserve / no-fallback, collect_mem with no collector and no fallback, and send_mem_event short-circuits for empty and all-NA cases
- Add t/proc.t covering _collect_proc happy path, missing procfile, empty procfile, files without Vm* lines, tab-separated values, and partial Vm* presence
- Add t/ps.t covering _collect_ps via stubbed ps_command (happy / empty / unparseable) plus an opportunistic real-ps subtest; skips on MSWin32 and any host without a usable shell echo
- Add t/win32.t covering _collect_win32 via a fake Win32::Process::Memory injected into %INC, exercising byte-to-kB conversion, undef return, exception in the underlying call, and partial-info handling
- Add t/getrusage.t covering _maxrss_kb (linux kB pass-through, darwin byte conversion, zero / empty getrusage), the collect_mem last-resort path when no native collector matched, and the augment_peak chain end to end against a fake BSD::Resource
- Extend t/memusage.t to assert that calling import() a second time does not register a duplicate exit callback
- Add Solaris, AIX, and HP-UX support by routing them through the existing _collect_ps backend (their POSIX ps accepts 'ps -o rss=,vsz= -p $$' and reports kilobytes); peak still benefits from the BSD::Resource fallback when installed
- Add real-system subtests to t/proc.t that verify the host's /proc/PID/status matches the shape our mocks assume and that _collect_proc returns numeric, positive, sanely-ranged values; both subtests skip when /proc is unavailable
- Add real-system subtests to t/ps.t that verify the host's 'ps -o rss=,vsz= -p $$' exits 0 with parseable output, and that _collect_ps returns numeric/positive/in-range values with kB units; both subtests skip when ps is missing (exit 127 / fork failure) and fail when ps is present but misbehaves
- Add real-system subtests to t/win32.t that verify the real Win32::Process::Memory returns the hash shape we assume and that _collect_win32 returns meaningful values; the fake module injection is now conditional so the real module is preferred when installed, and both new subtests skip off-MSWin32 or when Win32::Process::Memory is not installed
- Add real-system subtests to t/getrusage.t that verify the real BSD::Resource::getrusage returns at least 3 fields with a numeric ru_maxrss and that _maxrss_kb returns a meaningful value; the fake module injection is now conditional so the real module is preferred when installed
Documentation
Modules
Collect and display memory usage information.