On 2013/7/6 16:52, Willy Tarreau wrote: > On Sat, Jul 06, 2013 at 04:31:49PM +0800, Godbach wrote: >> I've got what you meant. Once allocated from system, haproxy will not >> release the memory until it receives SIGQUIT or does soft stop. If less >> memory during running is expected, just decrease the maxconn. >> >> In addition, can I consider that dlmalloc can be used to instead of >> CALLOC/MALLOC as your own suggestion to maintain better memory >> management in production. > > Yes, and for this you just need to put dlmalloc.c to a location pointed to > by DLMALLOC_SRC (default: src/dlmalloc.c) and build using USE_DLMALLOC=1 : > > cp ~/dlmalloc.c src/ > make TARGET=linux2628 USE_DLMALLOC=1 > > That said, the only benefit (which is important in my usage) is that the > calls to free() upon SIGQUIT or SIGUSR1 will really release the unused > memory, while with traditional malloc(), it will only happen once the > top of the memory is released. > > Regards, > Willy > >
I got it. Thank you. -- Best Regards, Godbach

