[question] stats print and prof dump #79
jasone at canonware.com
Fri May 2 15:51:56 PDT 2014
On May 2, 2014, at 2:34 PM, Sudurais A <sudurais at gmail.com> wrote:
> This is follow up question to https://github.com/jemalloc/jemalloc/issues/79
> 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 ?.
> 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.
> Is there any other way to dump memory objects with stack trace currently held (more like exit time output using prof_leak) periodically ?.
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 http://google-perftools.googlecode.com/svn/trunk/doc/pprof_remote_servers.html for format docs.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jemalloc-discuss