Hello!
On Sat, Aug 3, 2013 at 12:37 AM, Yichun Zhang (agentzh) wrote:
> BTW, I'm using the following systemtap script to trace this leak. One
> can also easily port it over to dtrace (for Mac OS X, Solaris, or
> FreeBSD):
>
> http://agentzh.org/misc/leaks.stp
>
It's worth mentioning that the output of the this simply systemtap
tool can also be used to generate a "Memory Leak Flame Graph". For
example, for this very leak in the Nginx core, we can get the
following "leak flamegraph":
http://agentzh.org/misc/flamegraph/nginx-memleak-2013-08-05.svg
This tool is very general and can be used to analyze *any* C processes
with DWARF debug info enabled.
I'll ask Guanlan Dai to add this tool to my Nginx Systemtap Toolkit in
the near future :)
BTW, glad to see that the official Nginx team has fixed this this leak
:) The fix is straightforward as expected, that is, just allocating in
the request memory pool instead of the global cycle one :)
Best regards,
-agentzh