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
recommend?
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.
[1]:
https://docs.raku.org/type/Telemetry.html
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
increasing.
-kolibrie