[Webkit-unassigned] [Bug 27980] Give an ability to WebKit to free statically allocated pointers before quit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 4 11:31:07 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27980





--- Comment #35 from Zoltan Herczeg <zherczeg at inf.u-szeged.hu>  2009-09-04 11:31:06 PDT ---
(In reply to comment #30)
> Zoltan, I understand your enthusiasm for this project and I am willing to
> review when I have the time. But this patch is not a high priority for me.
> 
> I would like this to be done right if it is done, I still don't think it's
> worth doing.
> 
> Who exactly is planning to take advantage of this change, and for what? Is the
> goal making leak-detection tools work better? Is someone planning to unload the
> WebKit library without exiting the process it's hosted in?
> 
> You say "sometimes it is good to free statically allocated pointers". When?

Perhaps this patch will be destined as an experimental solution. The big
qestion is: whether it is possible to make WebKit to an unloadable dll / shared
object. The answer is unknown at this moment, since noone tried it before, so
noone will start to consider this as an option because they feel this is a too
risky project. We just close the way before an interesting feature without
trying it.

First, I try to sort all global variables into groups. How globals are declared
and used in WebKit. Is there a redundant form, or all of them are necessary
(now I have only 3 groups).

Second, are the globals handled correctly. Some globals are change their value,
and we must make sure (in debug mode) their previous value is freed.

Right now I found only one exception to the reversed free order:
WebCore::pageCache() is allocated too early in QtLauncher (using
setMaximumPagesInCache), and its destructor frees a timer object. The calling
of timer::stop() causes segmentaion fault at that time.

I don't insist on the current form of global handling. If all globals are
declared as templates, anyone can change their behaviour (and make GlobalPtr to
a class if someone prefers that way).

The patch really helps to valgrind: a simple QtLauncher start-exit process left
around 300k leak, and this is reduced to 100k. The number of loss records
decreased from 400 to 100. It is much easier to find real leaks from that 100
loss records (especially because the remaing loss records are belongs to font
config and Qt internals).

There is one really good news: the work started 1.5 monts ago, and I had no
trouble upgrading it to the most recent version so far. Looks like maintaining
of this patch is not a hard work (hopefully).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list