RESOLVED DUPLICATE of bug 165622 149585
Heavy LocalStorage use can cause page to freeze
https://bugs.webkit.org/show_bug.cgi?id=149585
Summary Heavy LocalStorage use can cause page to freeze
Nolan Lawson
Reported 2015-09-27 07:11:42 PDT
Created attachment 261987 [details] Same HTML page as the live demo Doing many successive insertions into LocalStorage can cause the page to freeze, with an eternal spinning beach ball and no ability to interact with the page. I've got a live demo to repro: http://nolanlawson.github.io/database-comparison/ Steps: 1. Choose "LocalStorage" 2. Choose 100000 3. Click "insert docs" 4. Notice that the page is frozen, with a perma-beachball This bug cannot be reproduced in Edge, Firefox, or Chrome, but I note that Safari is the only browser out of the four to *not* block DOM rendering while LocalStorage operations are ongoing. :) I'm testing WebKit Nightly, Version 8.0.8 (10600.8.9, r190266)
Attachments
Same HTML page as the live demo (190.18 KB, application/zip)
2015-09-27 07:11 PDT, Nolan Lawson
no flags
Alexey Proskuryakov
Comment 1 2015-09-28 20:55:04 PDT
I feel like this may have been reported before, but I cannot find it now.
Brady Eidson
Comment 2 2015-09-29 12:46:46 PDT
This bug is not terribly surprisingly. That it doesn't happen in other browsers *is* kind of surprising; LocalStorage is a synchronous API, so it's very easy to abuse. Can you get a spin dump while this is happening?
Anders Carlsson
Comment 3 2015-09-29 12:50:16 PDT
(In reply to comment #2) > LocalStorage is a synchronous API ... This is not entirely true. The only synchronous operation is getting the initial values from the UI process.
Brady Eidson
Comment 4 2015-09-29 13:15:23 PDT
(In reply to comment #3) > (In reply to comment #2) > > LocalStorage is a synchronous API ... > > This is not entirely true. The only synchronous operation is getting the > initial values from the UI process. I wasn't talking about the way we've implemented I/O, but rather how it operates from script's perspective.
Arthur
Comment 5 2015-10-05 02:48:33 PDT
Seems like only Safari has asynchronous localStorage behind the scene. Indeed surprisingly that other browsers do all the ops in sync way, naturally they cannot have async/race bugs here. Anyway, thanks for doing localStorage async!
Brady Eidson
Comment 6 2015-10-15 14:09:34 PDT
I still don't have time to dig in to this myself at the moment, but would find a spindump very interesting. That would give the appropriate hints on how to solve this.
Mariusz Nowak
Comment 7 2016-11-26 10:02:58 PST
Alexey Proskuryakov
Comment 8 2016-12-14 09:27:00 PST
Could you please verify with the latest nightly? https://nightly.webkit.org *** This bug has been marked as a duplicate of bug 165622 ***
Note You need to log in before you can comment on or make changes to this bug.