Memory not getting released

After a reload, old haproxy process remains there and doesn’t release memory (sometime it does but behaviour is not consistent). After killing the old process (several days old) the memory get released.

Expected behavior: We have long lived connections but these connections should be cleared after 4-7 hours max from old process and after that old process should be end or consume very small footprint (in case any connection still hang around).

Compile time info:
$ wget $ wget $ apt-get install -y libssl-dev make libpcre3-dev $ tar zxvf haproxy-1.5.14.tar.gz; cd haproxy-1.5.14/ $ make TARGET=linux2628 CPU=native USE_STATIC_PCRE=1 ADDLIB=-lz USE_OPENSSL=1 DLMALLOC_SRC=../malloc.c $ make install

Further information:
` ubuntu@ip-10-0-5-193:~$ uname -a
Linux ip-10-0-5-193 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ubuntu@ip-10-0-5-193:~$ haproxy -v
HA-Proxy version 1.5.14 2015/07/02
Copyright 2000-2015 Willy Tarreau

ubuntu@ip-10-0-5-193:~$ date
Tue Apr 5 00:44:29 UTC 2016

ubuntu@ip-10-0-5-193:~$ ps -ef | grep [h]aproxy
haproxy 7494 1 15 Apr01 ? 13:26:20 /usr/local/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/ -D -sf 30065
haproxy 13357 1 18 Apr04 ? 02:40:15 /usr/local/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/ -D -sf 7494

ubuntu@ip-10-0-5-193:~$ free -g
total used free shared buffers cached
Mem: 29 26 3 0 0 0
-/+ buffers/cache: 25 4
Swap: 0 0 0

ubuntu@ip-10-0-5-193:~ sudo kill 7494 ubuntu@ip-10-0-5-193:~ free -g
total used free shared buffers cached
Mem: 29 10 19 0 0 0
-/+ buffers/cache: 9 20
Swap: 0 0 0`

Sounds like the problem is that the old process doesn’t exit. Memory not getting released is just the symptom. Upgrade to latest stable 1.5.18 which contains fixes for stale haproxy processes.

Are you using dlmalloc for a specific reason or was that an attempt to fix this issue?

@lukastribus we have upgraded to 1.5.18 but still facing memory issue Haproxy Memory Issue : its old process have occupied hefty memory