ConfD User Community

Memory leak in ConfD


We are running Confd 6.4.3 successfully on an embedded system and from functionality perceive things are working fine. What we are observing in long term stability is that ConfD is slowly depleting the memory. Slowly means that our system runs out of RAM in cca. 200 days. All this is based on observation and statistical gathering of data in /proc//statm (and comparing that with available memory of the system (MemAvailable under /proc/meminfo) ). In average ConfD process is »eating up« roughly 1-2 MB of RAM per day. I have mentioned average because we see a lot of fluctuation (up to +/- 10MB) in terms of how resources (RAM) is being used by ConfD. Based on other comments on the forum I believe this fluctuation can be linked to internal ”pool allocator” that confD uses for managing memory.

Due to the above, the fact that we are using a pre-built ConfD binary (stripped) and the fact that we are running on an embedded system (ARM; with limited CPU performance) It is very hard to debug this with Valgrind (or similar tools). So first of all I would like to ask if there is any know similar issue in ConfD 6.4.3 that might be contributing factor to what we are seeing?

Is there another way that we might take to try to get to the bottom of this. We have also been taking stats with “confd –status” and we do not see any changes in the diffs that we could linked to the memory usage. Things that are changing are:

  • under “user_Sessions”: SessionID and tid. (We have tried simulating a lot of new user sessions but this did not impact memory usage)
  • under “cdb” -> “operational”: RAM Size and Disk Size. (This is changing but is always in the range between few 100KB to 3 MB)
  • under “tss alloc”: We don’t exactly know what the values there define but we don’t see any similar increases that would be in line with memory usage.

Due to mem consumption fluctuation and relatively long time to see a differed in memory usage it is also hard to debug this indirectly (like removing part of functionality, etc).

Any info or guidance would be helpful.


To check the “high point” of ConfD RAM memory consumption and the current RAM memory usage you can (from a script or command line) do something like:

echo "Memory usage ConfD:"
pid=`pidof confd`
result=$(cat /proc/$pid/status | grep -A 1 VmHWM)
echo $result;

The result would be something like:

VmHWM: 234567 kB VmRSS: 123456 kB

where VmHWM is the high watermark and the VmRSS the current memory consumption.
The Linux community have more details on this.