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.
Created attachment 270619 [details] Patch
Comment on attachment 270619 [details] Patch Clearing flags on attachment: 270619 Committed r196104: <http://trac.webkit.org/changeset/196104>
All reviewed patches have been landed. Closing bug.
Re-opened since this is blocked by bug 153940
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.
Comment on attachment 270795 [details] Patch for relanding Clearing flags on attachment: 270795 Committed r196217: <http://trac.webkit.org/changeset/196217>
Rolled out in <https://trac.webkit.org/changeset/202139>
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.
Created attachment 281557 [details] Patch
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.
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;
Created attachment 281559 [details] Patch for landing
Comment on attachment 281559 [details] Patch for landing Clearing flags on attachment: 281559 Committed r202166: <http://trac.webkit.org/changeset/202166>