develooper Front page | perl.perl6.users | Postings from March 2023

suggestions for tracking down memory leaks

Nathan Gray
March 24, 2023 02:51
suggestions for tracking down memory leaks
Message ID:
I have a program that I intend to run for days or weeks at a
time, but it is being killed by the OS after a day or so, I think
because it is using up too much memory (growing over time). I
would like to be able to debug the memory leak and find out where
it is happening, so I can fix it.

What tools, modules, or procedures do you recommend for tracking
down a memory leak?

The program itself is short, but uses a multitude of modules,
some of which are custom built for this program, and some that
are open source.

What seems ideal to me would be to have a list of which objects
exist, with snapshots of that over time, so I can see which
objects are growing in number, and which are staying relatively
stable. Or maybe there is something better. What do you

I tried using Telemetry[1] max-rss to see if I could detect memory
increases, but the number returned from that stays constant over
the course of the program running.  Looking at the output from
top, it shows a slow increase in memory usage over time.


Most everything in the program is stored within a central object,
and outputting a snapshot of that every few minutes shows it
growing and shrinking over time, and it is not steadily

-kolibrie Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About