Bug 51335

Summary: [Qt][WK2] MappedMemoryPool is unbounded
Product: WebKit Reporter: Balazs Kelemen <kbalazs>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: kimmo.t.kinnunen, laszlo.gombos
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Balazs Kelemen 2010-12-20 08:09:03 PST
The pool of mapped memory areas used by UpdateChunk's never release memory.
This means when you resize the window to a bigger size n times we are using n piece of big area while typically one medium size
would be enough for updates.
Comment 1 Balazs Kelemen 2010-12-20 08:58:35 PST
Created attachment 77009 [details]
Patch
Comment 2 Balazs Kelemen 2010-12-20 15:15:34 PST
Created attachment 77042 [details]
Patch

Eliminated the pointless base class, otherwise the same as the last one.
Comment 3 Balazs Kelemen 2011-01-03 10:41:46 PST
Comment on attachment 77042 [details]
Patch

First need to solve #51474 to avoid conflicts.
Comment 4 Balazs Kelemen 2011-01-05 05:16:57 PST
Created attachment 77989 [details]
Patch
Comment 5 Kimmo Kinnunen 2011-01-05 23:04:38 PST
This addresses a quite serious problem with MemoryMappedPool, good. However I'm not really convinced that anybody should spend that much time polishing current MemoryMappedPool before it really is working well.

To me, this patch just adds complexity on top of simple implementation. To me, address space running out is the least of the worries for MemoryMappedPool.

The simple implementation was initially done just to get WK2 on Qt working -- it is not meant as end-all design.

I opened another bug that discusses current problems:
https://bugs.webkit.org/show_bug.cgi?id=51984

Some of the problems are amplified by this patch. At least:
- this patch adds even more calls that don't check errors (file opens, mmaps)
- this patch adds polish (enums instead of bools)  to the isFree flag, which is incorrect anyway
Comment 6 Balazs Kelemen 2011-01-19 08:25:31 PST
Comment on attachment 77989 [details]
Patch

We should make a consensus about do
we really need the pooling 
optimization. Postpone this work until
it has been done.
Comment 7 Kimmo Kinnunen 2011-01-19 10:41:25 PST
(In reply to comment #6)
> (From update of attachment 77989 [details])
> We should make a consensus about do
> we really need the pooling 
> optimization. Postpone this work until
> it has been done.

Or, I can add that pooling if it makes you happy. Should I do that and do another patch?
Comment 8 Balazs Kelemen 2011-01-19 14:21:50 PST
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 77989 [details] [details])
> > We should make a consensus about do
> > we really need the pooling 
> > optimization. Postpone this work until
> > it has been done.
> 
> Or, I can add that pooling if it makes you happy. Should I do that and do another patch?

It's not about my happiness. If your experiences (benchmarks, profiling, 
user experience on device, etc.) does not justify the value of the optimization
then it should be removed. We can reintroduce it in the future if mmap will be a bottleneck.