Storage leaks
James Browning
jamesb192 at jamesb192.com
Sun Jan 12 22:11:41 UTC 2025
On Sunday, January 12, 2025 12:27:51 PM Pacific Standard Time Hal Murray via
devel wrote:
> Once upon a time, there was code that would free up most/all of the memory
> that we had allocated when ntpd exited. So valgrind could be used to look
> for storage leaks without having to wade through too much noise.
>
> Has anybody tried that lately?
I have not.
> How much to we care about storage leaks? How much effort should we put
> into making sure the exit cleanup gets everything?
Most allocated resources are supposed to get cleaned up at process exit. The
exceptions would probable be things like shared memory, semaphores, message
queues, UNIX sockets and such. AFAICT We have not used the message queues or
semaphores, we only used shared memory for the SHM refclock, and UNIX sockets
are only mentioned for a refclock that never made it into tree.
I would be more concerned in the near and intermediate terms about the
possibility of allocating memory to pointer that already have associated
memory.
> Is there a clean way to get the total amount of memory allocated? it
> would be easy to monitor that.
I do not know about clean. I would prefer something I could just set and
forget about until I needed to grab stats. A website suggested Slurm, so I
will look at it disapprovingly.
More information about the devel
mailing list