-
-
01 Oct 2010 20:37:28 UTC
- Distribution: Memory-Usage
- Module version: 0.201
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (4231 / 0 / 0)
- Kwalitee
Bus factor: 0- 26.00% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (19.28KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 2 contributors- Dave O'Neill, C<< <dmo at dmo.ca> >>
-
Dave O'Neill
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Memory::Usage - Tools to determine actual memory usage
VERSION
Version 0.201
SYNOPSIS
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();
DESCRIPTION
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.
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.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
Search CPAN
SEE ALSO
-
Iteratively run coderefs (similar to Benchmark) and compare their memory usage. Useful for optimizing specific subroutines with large memory usage once you've identified them as memory hogs. Uses same technique for gathering usage information as this module, so accuracy and precision suffer similarly.
-
Show the size of Perl variables. Also useful for microoptimzations when you know what you're looking for. Looks at Perl internals, so accuracy is good.
LICENSE AND COPYRIGHT
Copyright 2010 Dave O'Neill.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Module Install Instructions
To install Memory::Usage, copy and paste the appropriate command in to your terminal.
cpanm Memory::Usage
perl -MCPAN -e shell install Memory::Usage
For more information on module installation, please visit the detailed CPAN module installation guide.