Created attachment 57216 [details]
Screen shot of memory consumption
I'm wondering if there's a memory retention issue given the use of timers. Here's some html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<title>Timer Memory Retention</title>
<p>Please observe memory usage with the timeline profiler.</p>
What we have is a script that simply sets up a timer to execute every 100ms. It makes no difference to the test whether a function is called on the timer firing.
If you load this and then use the timeline profile then you should observe memory continue to be consumed. Within a couple of minutes memory usage doubles. I have had this running for several minutes with no apparent reduction in the rate of memory consumed.
I have attached a screenshot of the memory consumption timeline.
I hope the timeline profiler excludes memory use by the inspector itself.
(In reply to comment #1)
> I hope the timeline profiler excludes memory use by the inspector itself.
It doesn't. That could be the issue.
Hi Geoff. Do you have a feel for whether this issue is easily resolved?
(In reply to comment #3)
> Hi Geoff. Do you have a feel for whether this issue is easily resolved?
If the Web Inspector guess is true, it's not easily resolved. We would need to move the Web Inspector to use a separate heap/JSGlobalData. Doable, but nontrivial.
I've now downloaded WebKit and built it. I'd be happy to have a go at fixing this issue if someone can point me in the right direction. I have a memory retention issue in my application in production and I simply must nail down what is causing it so I'm keen to help!
> I have a memory retention issue in my application in production
Is this on Mac OS X? Have you tried the simple stuff, like running 'leaks'?
(In reply to comment #6)
> Is this on Mac OS X? Have you tried the simple stuff, like running 'leaks'?
(In reply to comment #7)
I just profiled the app using leaks as part of Instruments under OS X. What I found was that WebKit/Safari does *not* appear to be leaking memory adding strength to the view that the memory profiler of WebKit is not considering its own object allocations in its output. I attach the Instruments view over several minutes of running WebKit/Safari (debug build).
Any ideas then on where I should start looking in the WebKit code with a view to helping fix the memory profiler part of the Web Inspector?
Created attachment 57619 [details]
Screen shot of memory profile using Instruments
Anyone out there care to point me toward some doco that gives an introduction to the Web Inspector architecture, or better still a hint on where to start looking? I would have thought they'd be some interest in getting this problem resolved...
Created attachment 62510 [details]
Sample HTML file to reproduce the issue
Attached an HTML/JS file that easily illustrates the problem.
Still a problem with Lion, and also occurs with the Canary build of Chrome. Any interest at all out there?
This should be resolved now that Inspector runs in its own process. Please re-open or file new bug if you feel that's not the case.