Memory::Usage(3pm)

Memory::Usage3pm

Tools to determine actual memory usage

Usage

    use Memory::Usage;
    my $mu = Memory::Usage->new();
    # Record amount of memory used by current process
    $mu->record('starting work');
    # Do the thing you want to measure
    $object->something_memory_intensive();
    # Record amount in use afterwards
    $mu->record('after something_memory_intensive()');
    # Spit out a report
    $mu->dump();

Version

Version 0.201

Overview

This module lets you attempt to measure, from your operating system's perspective, how much memory a process is using at any given time.

Methods

Class Methods

new ( )

Creates a new Memory::Usage object. This object will contain usage state as recorded along the way.

Instance Methods

record ( $message [, $pid ])

Record the memory usage at call time, logging it internally with the provided message. Optionally takes a process ID to record memory usage for, defaulting to the current process.

report ( )

Generates report on memory usage.

dump ( )

Prints report on memory usage to stderr.

state ( )

Return arrayref of internal state. Returned arrayref contains zero or more references to arrays with the following columns (in order). All sizes are in kilobytes.

timestamp (in seconds since epoch)
message (as passed to ->record())
virtual memory size
resident set size
shared memory size
text (aka code or exe) size
data and stack size

Support

You can find documentation for this module with the perldoc command.

    perldoc Memory::Usage

You can also look for information at:

•

RT: CPAN's request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Memory-Usage>

•

Search CPAN

<http://search.cpan.org/dist/Memory-Usage/>

Releases

6 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10–11
  3. 12–13
  4. Arch

Author

Dave O'Neill, "<dmo at dmo.ca>"

Bugs

Please report any bugs or feature requests to "bug-memory-usage at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Memory-Usage>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

From perl-memory-usage 0.201-6 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.