NEW156745
Memory usage grows when certain pages are left open
https://bugs.webkit.org/show_bug.cgi?id=156745
Summary Memory usage grows when certain pages are left open
Stephen Reay
Reported 2016-04-19 07:00:11 PDT
Created attachment 276724 [details] Several Google Docs tabs Leaving a google docs spreadsheet or twitter feed open can result in massive amounts of memory being consumed. This does *not* seem to happen in the Nightly Build (WebKit-SVN-r199707), but *does* happen in Safari 9 & Technology Preview
Attachments
Several Google Docs tabs (210.91 KB, image/png)
2016-04-19 07:00 PDT, Stephen Reay
no flags
Twitter tab left open after several hours (215.51 KB, image/png)
2016-04-19 07:00 PDT, Stephen Reay
no flags
Activity Monitor Screenshot (305.84 KB, image/png)
2016-07-25 11:44 PDT, James Pulizzi
no flags
Stephen Reay
Comment 1 2016-04-19 07:00:56 PDT
Created attachment 276725 [details] Twitter tab left open after several hours
Stephen Reay
Comment 2 2016-04-19 08:54:55 PDT
OK, I've done some more testing. It *appears* to be somehow related to either console errors in general, or specifically to blocked attempts to load URLs. It is easily reproducible on Google docs with the Ghostery extension enabled (and appropriate options selected - "Select All" should be OK to reproduce the issue) Without Ghostery extension enabled, it can be seen on sites like http://uberhumor.com which repeatedly make a lot of third party requests (and thus hit regular Same-Origin policy restrictions) I still haven't been able to reproduce to the same extent seen in 9/Tech Preview when using the Nightly Build.
Radar WebKit Bug Importer
Comment 3 2016-04-20 09:46:07 PDT
Andreas Kling
Comment 4 2016-06-14 22:59:28 PDT
(In reply to comment #2) > It is easily reproducible on Google docs with the Ghostery extension enabled > (and appropriate options selected - "Select All" should be OK to reproduce > the issue) I'm struggling to reproduce this. What kind of document are you viewing? Is it a collaborative document? Could you share it here? How long are you leaving it open? If you could break down how to reproduce this into steps I would love to debug it.
Stephen Reay
Comment 5 2016-06-15 00:41:54 PDT
It happens on google docs spreadsheets with multiple sheets, I'd guess I've probably left them open for an hour or so. I can't share the exact documents I noticed it on as they belong to a client, but I will try to find/create one that does it. Additionally, it seems pretty reproducible on sites that try to include lots of 3rd party trackers. As I said, visiting http://uberhumor.com will reach about 1G of 'real memory' used after hitting 'next page' until the 12th page. In the Tech preview it now seems to be less noticeable than the shipping version - e.g. the uborhumor site got to page 27 and was just under 1G. I'll post back later with more info about google docs and/or twitter use-case to reproduce it.
Andreas Kling
Comment 6 2016-06-15 00:56:12 PDT
(In reply to comment #5) > It happens on google docs spreadsheets with multiple sheets, I'd guess I've > probably left them open for an hour or so. I can't share the exact documents > I noticed it on as they belong to a client, but I will try to find/create > one that does it. Sure, any reliable repro case you can construct would be immensely useful. > Additionally, it seems pretty reproducible on sites that try to include lots > of 3rd party trackers. As I said, visiting http://uberhumor.com will reach > about 1G of 'real memory' used after hitting 'next page' until the 12th page. > In the Tech preview it now seems to be less noticeable than the shipping > version - e.g. the uborhumor site got to page 27 and was just under 1G. The uberhumor page seems to exhibit the same growth in other browsers too. Based on that I think it's an issue with the content on the site behaving badly, not a browser bug. Glad to hear the tech preview is at least doing a bit better, there are a number of memory fixes in there. Hopefully we can find something to do about this issue too. > I'll post back later with more info about google docs and/or twitter > use-case to reproduce it. Okay!
Andreas Kling
Comment 7 2016-06-15 01:25:02 PDT
Since you mentioned spreadsheets with multiple subsheets, I went and played around with it. I found this repro case: 1) Create an empty new spreadsheet. 2) Add a second subsheet to it (+ button in bottom corner) 3) Switch back and forth between Sheet1 and Sheet2. Memory usage goes up slightly every time you switch between the sheets. You can supercharge this repro by holding down the key combo to switch to next sheet (Cmd-Shift-PageDn.) That way you'll reach 1GB in a matter of seconds. This works every time for me in WebKit, Gecko and Blink. The memory is not released after waiting for quite some time. Only navigating away from the spreadsheet (for example back to the main Google Docs menu) frees up the memory. Is this similar to the growth you've been seeing? Do you do a lot of switching between the sheets?
Stephen Reay
Comment 8 2016-06-15 01:45:59 PDT
Not so much continually switching tabs no. I just opened a doc and it immediately has ~420 mb used, the doc has 9 Sheets, most are less than 50 rows of actual content (some are the default 1K rows, but mostly empty cells). One has a lot of columns (A to BI) but most are no more than 10 or so columns. It is a collaborative document, and the memory usage is usually after leaving it open for quite a while (I’m basically opening it to refer to something in one sheet, not closing it, and wondering why everything is slow 2 hours later). I’ve copied & lipsum-ified the document i saw an issue on - just in the time its taken me to replace the sensitive text, memory usage of ‘docs.google.com is at 1.33GB. https://docs.google.com/spreadsheets/d/1V-dy5UqhksRmMYueJTl8n11jy0CC3jXA53K8rhBpTMw/edit?usp=sharing
James Pulizzi
Comment 9 2016-07-25 11:43:41 PDT
I've experienced this issue when using Google Sheets in Safari Technology Preview (Release 9) on Mac OS 10.11.6. The sheet does not have multiple tabs, but collaborators are editing the sheet while I have it open in the browser. At one point, the memory usage exceed 6 GB. I've included a screenshot of it using 1.5 GB after only being open for 10 minutes. The same sheet in Chrome 52 only uses about 300 MB.
James Pulizzi
Comment 10 2016-07-25 11:44:23 PDT
Created attachment 284509 [details] Activity Monitor Screenshot
Josh Danziger
Comment 11 2016-10-07 13:24:21 PDT
(In reply to comment #7) On behalf of the Google Sheets team, thank you for the detailed repro steps. We fixed a bunch of leaks when switching sheets that will roll out in the coming weeks. If you hold down Ctrl+Shift+PgDn, memory use will go up for a minute or so but should be eventually garbage collected.
Note You need to log in before you can comment on or make changes to this bug.