<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On May 2, 2014, at 2:34 PM, Sudurais A <<a href="mailto:sudurais@gmail.com">sudurais@gmail.com</a>> wrote:<div><blockquote type="cite"><div dir="ltr"><div>This is follow up question to <a href="https://github.com/jemalloc/jemalloc/issues/79" target="_blank">https://github.com/jemalloc/jemalloc/issues/79</a><br><div><br></div><div>We wanted to periodically monitor memory usage with stack-trace of each allocation in multi-threaded application. Currently, I could dump memory usage (potential leak's) at exit time of the program. Is it possible to report memory usage (prof_fdump) called with leak enabled using timer thread while others threads are working on ?. </div>
<div><br></div><div>Is there risk of calling 'prof_fdump' with leak directly from program ?. Currently prof_fdump is static function. Thats needed to be changed for this purpose. I will make sure only one thread (caller) calls prof_fdump. </div>
<div><br></div><div>Is there any other way to dump memory objects with stack trace currently held (more like exit time output using prof_leak) periodically ?. </div></div></div></blockquote></div><br><div>The dump that prof_fdump() creates is essentially the same as any other heap profile dump jemalloc does, other than the leakcheck messages that are written to stderr. You can trigger dumps via the "prof.dump" mallctl and specify any filename you want, or specify no filename and rely on the default filename scheme. From there, you can easily compute the equivalent leakcheck message via some processing of the heap profile dump. Leaked bytes and objects come from the first line, and the number of contexts is the line count starting after the header line and preceding the first blank line. See <a href="http://google-perftools.googlecode.com/svn/trunk/doc/pprof_remote_servers.html">http://google-perftools.googlecode.com/svn/trunk/doc/pprof_remote_servers.html</a> for format docs.</div><div><br></div><div>Jason</div></body></html>