This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 437
[Safari/General] Schedule manually updating filter lists less aggressively to give time for garbage collection #978
Comments
chrisaljoudi
added
Combined with another issue
and removed
Combined with another issue
labels
Mar 10, 2015
chrisaljoudi
changed the title
[Safari/General] Make updating filter lists less aggressive to give time for garbage collection
[Safari/General] Schedule updating filter lists less aggressively to give time for garbage collection
Mar 10, 2015
When you say "give time for garbage collection", how many seconds to do you in mind? |
@gorhill 3-5 seconds seems to be plenty. Minimum one could get away with is around 1s. |
gorhill
added a commit
that referenced
this issue
Mar 11, 2015
Fixed in 39ad158. |
gorhill
changed the title
[Safari/General] Schedule updating filter lists less aggressively to give time for garbage collection
[Safari/General] Schedule manually updating filter lists less aggressively to give time for garbage collection
Mar 12, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now, when uBlock is updating filter lists, it grabs and parses them as quickly as it can receive and parse them.
In some cases, when there's a large quantity of those updates, the memory allocation for all the "new" resources occurs before the browser has had a chance to actually garbage collect and deallocate memory.
This is what happens in #964. In the case of Safari, this causes it to run out of memory and crash as it fails trying to allocate more memory. In that case, it took only a couple of large filter lists (EasyList and the Russian list) to reproduce the crash.
This is problematic, especially with cases with a lot of lists/system with little memory. The crash is arguably a Safari bug — it seems like it would be beneficial in general to have filter list updates be less aggressive and more atomic as not to pressure memory.
Perhaps there should be an update task running in the background to perform the updates. It might wait, say, 10 seconds between any two consecutive updates.
In that case, clicking "Update Now" doesn't necessarily go and trigger every request all at once, but rather marks enabled filters as needing an update. The update task, like a janitor, will come along and sweep the needed updates asynchronously.
#965 would make a lot of sense implement alongside this.
@gorhill as always, I'm happy to own this particular fix/issue if you don't have time to work on it. Please let me know.
The text was updated successfully, but these errors were encountered: