Commit 1e8d68c
committed
Improve Quota Manager accuracy to mitigate "disk full" issues
Depending on the backend used to store data controlled by
the Quota Manager (e.g. SQLite), the amount of actual disk
space used to store a given amount of data may be much
greater than the size of the actual data.
Currently, the real disk usage is used only at start to
determine the available quota, and after exhausting this
quota which ignores the overhead.
While the eviction algorithm will attempt to free data
across different origins, depending on the origin and
total ratios configured, as well as the amount of data
written by the app without restarting the browser, we
may end up running out of space on constrained devices.
To mitigate this, whenever the Quota Manager receives a
space request, we force the read of the real usage after
consuming 25% of the theoretically available space since
the last time the real usage was evaluated. If the
remaining available space is too small that the overhead
becomes insignificant (100 KB), we just take all remaining
space available from that point on.1 parent f5892cd commit 1e8d68c
1 file changed
Lines changed: 9 additions & 0 deletions
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
| |||
0 commit comments