Bug 153851

Summary: [iOS] Throw away linked code when navigating to a new page.
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore JavaScriptAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, cdumez, commit-queue, japhet, keith_miller, kling, mark.lam, msaboff, saam
Priority: P2 Keywords: Performance
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 153940    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch for relanding
none
Patch
none
Patch
koivisto: review+
Patch for landing none

Andreas Kling
Reported 2016-02-03 17:51:07 PST
We can keep our peak memory usage down by throwing away linked code when navigating to a new page. Since linked code is tied to a specific global object, it won't be useful to the incoming page. In the event of a backwards navigation, the cost of relinking that code is far lower than the memory cost of keeping it around.
Attachments
Patch (4.86 KB, patch)
2016-02-03 17:54 PST, Andreas Kling
no flags
Patch for relanding (5.71 KB, patch)
2016-02-06 08:02 PST, Andreas Kling
no flags
Patch (3.64 KB, patch)
2016-06-17 05:12 PDT, Andreas Kling
no flags
Patch (4.36 KB, patch)
2016-06-17 05:13 PDT, Andreas Kling
koivisto: review+
Patch for landing (4.34 KB, patch)
2016-06-17 05:57 PDT, Andreas Kling
no flags
Andreas Kling
Comment 1 2016-02-03 17:54:32 PST
WebKit Commit Bot
Comment 2 2016-02-03 19:12:29 PST
Comment on attachment 270619 [details] Patch Clearing flags on attachment: 270619 Committed r196104: <http://trac.webkit.org/changeset/196104>
WebKit Commit Bot
Comment 3 2016-02-03 19:12:35 PST
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 4 2016-02-06 02:08:29 PST
Re-opened since this is blocked by bug 153940
Andreas Kling
Comment 5 2016-02-06 08:02:28 PST
Created attachment 270795 [details] Patch for relanding Let's try to re-land this with a fix: don't throw away code unless we're navigating away from an existing history item. Or basically only do this if the navigation is PageCache-eligible.
WebKit Commit Bot
Comment 6 2016-02-06 09:00:34 PST
Comment on attachment 270795 [details] Patch for relanding Clearing flags on attachment: 270795 Committed r196217: <http://trac.webkit.org/changeset/196217>
WebKit Commit Bot
Comment 7 2016-02-06 09:00:37 PST
All reviewed patches have been landed. Closing bug.
Andreas Kling
Comment 8 2016-06-16 16:59:43 PDT
Andreas Kling
Comment 9 2016-06-17 05:12:35 PDT
Created attachment 281556 [details] Patch Same thing again, but this time we only do it if we haven't navigated in the last 2 seconds. This looks a bit cheesy at first sight, but I can't think of a simpler fix for the excessive work problem.
Andreas Kling
Comment 10 2016-06-17 05:13:51 PDT
WebKit Commit Bot
Comment 11 2016-06-17 05:15:02 PDT
Attachment 281557 [details] did not pass style-queue: ERROR: Source/WebCore/platform/MemoryPressureHandler.cpp:43: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Antti Koivisto
Comment 12 2016-06-17 05:52:54 PDT
Comment on attachment 281557 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=281557&action=review > Source/WebCore/platform/MemoryPressureHandler.cpp:167 > + const auto minimumTimeSinceNavigation = std::chrono::seconds(2); Could just say const auto minimumTimeSinceNavigation = 2s;
Andreas Kling
Comment 13 2016-06-17 05:57:18 PDT
Created attachment 281559 [details] Patch for landing
WebKit Commit Bot
Comment 14 2016-06-17 06:35:33 PDT
Comment on attachment 281559 [details] Patch for landing Clearing flags on attachment: 281559 Committed r202166: <http://trac.webkit.org/changeset/202166>
WebKit Commit Bot
Comment 15 2016-06-17 06:35:38 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.