This module would attempt to tell you how much memory your process is using,
so your process could shutdown, restart or take other actions if it is
getting too large.
The interface would be:
Sys::MemoryUsage->total_vm; # Total virtual memory in use.
Sys::MemoryUsage->data_segment; # Data segment size
Sys::MemoryUsage->stack_segment; # Stack segment size
Sys::MemoryUsage->text_segment; # Text segment size
If any of the values are unknown that method would return undef. On some
OSes, all the methods might return undef. Total_vm might either sum up
all the known values, or might get the total value directly from the OS.
It's possible total_vm may be more than the sum of the parts, depending
on how the value is obtained.
Currently the only way I know to get a memory usage figure is to install
mod_perl and then call &$Apache::SizeLimit::HOW_BIG_IS_IT(). The problems
with this are:
- This only retrieves one value
- Finding out the amount of memory in use shouldn't require installing
mod_perl.
- The HOW_BIG_IS_IT routine is not a documented interface for the
Apache::SizeLimit module.