finding memory leaks with mdb and loading libumem

we can take advantage of LD_PRELOAD and UMEM_DEBUG flags to get memory leaks caused by malloc/free function calls.mdb is useful in this situation.

Using mdb and loading libumem we can find running process memory leaks.

(1) set ,UMEM_DEBUG=default

(2) run your process, note down its processID

(3) gcore 1090
( 1090 is processID and gcore generate core.1090 file)

(4)mdb core.1090
(use this command to open mdb)
check is loaded properly (u can use ::load command)

(5) Once mdb loaded use "::findleaks" command to find memory leaks.
(::findleaks -dvf) use this options to see complete stack trace.