Devel::Jemallctl - Insight into what Jemalloc is doing
Basically, Devel::MallInfo for Jemalloc.
Devel::MallInfo
use Devel::Jemallctl; my $stats = Devel::Jemallctl::refresh_and_get_stats; printf "Current allocated/active/metadata/resident/mapped: %d/%d/%d/%d/%d", @$stats{qw/allocated active metadata resident mapped/};
Requires a jemalloc compiled with --enable-stats.
--enable-stats
glibc uses mallinfo for exporting statistics, jemalloc has its own mallctl, which means that Devel::MallInfo is useless when using jemalloc. This module aims to cover the same use case: finding out how much memory a Perl process is using.
mallinfo
mallctl
Hopefully in the future more mallctl options will be added, allowing for actual configuration of jemalloc in addition to getting statistics out.
Refreshes jemalloc's internal stats and returns basic stats, if available.
my $stats = Devel::Jemallctl::refresh_and_get_stats;
Outputs jemalloc's statistics on STDERR. Useful for quick analysis.
Devel::Jemallctl::print_stats();
Tom van der Woerdt, <tvdw@cpan.org>
<tvdw@cpan.org>
Copyright 2017 Tom van der Woerdt.
Full license see README
README
To install Devel::Jemallctl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Jemallctl
CPAN shell
perl -MCPAN -e shell install Devel::Jemallctl
For more information on module installation, please visit the detailed CPAN module installation guide.