Bill Kelly
3/23/2005 2:00:00 AM
From: "Joe Van Dyk" <joevandyk@gmail.com>
>
> My application's size in memory seems to be increasing by about 250KB
> a second. This is not a good thing.
>
> Are there any tools or strategies that I can use to track down the leak?
This might be kind of whacky, but maybe:
set_trace_func proc {|event, file, line, id, binding, classname|
printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
print `ps -u #$$`
}
This (on Linux) should print a trace of every line of
your program being executed, followed by some memory usage
information for the process. ... And slow down your app by
3 or 4 orders of magnitude... ;)
Well, just a thought... Like, you could log the output to
a text file, then go back and see where the memory was increasing,
and see if it correlates to any particular part of the code?
Regards,
Bill