suggestions for tracking down memory leaks

[email protected] (Nathan Gray)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQcdVBq2runIfiYui1iVlJyleoqBAUCZBnrfAAKCRBiVlJyleoq
BAplAJ4pCr4CfEIBwdl8A9ZvtYIl34HF4ACfWm3bJ/HpSepTGuRjWjUJxbiM1/4=
=9yaQ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.