A tool I found useful for this is massif from the valgrind suite, e.g.: valgrind --tool=massif --stacks=yes --alloc-fn=Perl_safesysmalloc --alloc-fn=Perl_safesyscalloc --alloc-fn=Perl_safesysrealloc --alloc-fn=Perl_Slab_Alloc --time-unit=B --max-snapshots=1000 perl -MMath::Prime::XS=:all -E 'say 1' (in this case, load up a module and do basically nothing else), then: massif-visualizer massif.out.#### [#### depending on the file] to see the graphical results. This shows, for example, a memory spike from Perl__invlist_union_maybe_complement_2nd that shows up in 5.20.0 and 5.21.2 that is not in 5.19.7 when processing constant.pm's: my $normal_constant_name = qr/^_?[^\W_0-9]\w*\z/; which means it hits lots of modules. Tracking down the Perl source that causes given memory behavior is not very straightforward, but I think the tool is pretty valuable for seeing how memory is being used, and what is causing the use, over time. --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=122283Thread Next