Fix the use of PRAGMA incremental_vacuum
Categories
(Core :: Storage: IndexedDB, task, P3)
Tracking
()
People
(Reporter: janv, Unassigned)
References
Details
(Whiteboard: dom-lws-bugdash-triage)
We currently execute PRAGMA incremental_vacuum as a simple statement (ignoring any results) which leads to freeing just one page at a time. The pragma needs to be executed as a statement returning rows. See https://stackoverflow.com/questions/53746807/sqlite-incremental-vacuum-removing-only-one-free-page
So https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#7063 should be replaced with a loop which calls ExecuteStep until there are no results.
We can probably get rid of the split into 10% chunks, see https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#7009 because ExecuteStep frees one page at a time anyway and we can check for pending events in the new loop which will provide better reaction when the connection suddenly becomes active.
I also suspect that we free just one page at https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#13770
It seems that pragma needs to be executed using a loop and ExecuteStep as well.
| Reporter | ||
Comment 1•2 years ago
|
||
It seems that Cache API might have the same problem:
https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/cache/DBSchema.cpp#2285
| Reporter | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Description
•