Score:0

Strategies for detecting daemon memory leaks

gu flag
QF0

I have a system which sends an email to a user twice a day, confirming that a specific daemon is still running and doing something. This has historically run for over a year without a restart, but the code has now changed, and I need to confirm that it's not leaking memory (minimally, without profiling/etc).

The user isn't technical, and I don't want to supply too much information, because it will be ignored, so I'm planning on adding a single line to the mail that says something like 'Current memory usage is x'.

Question: what number do I use for 'x'? The obvious choices are the drs, rsz, vsz, and size numbers from ps. pmap and the various proc values appear to produce a number which is basically vsz.

More specifically, if the (C++) code is leaking memory, then that memory may be unreachable, and so will have been swapped out, and so won't appear in the resident set. If this is the case, will the memory ever 'fill' and cause a crash anyway? And presumably drs and rsz have no value in this case? size looks like it may be appropriate but the man page says that it's not particularly reliable.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.