-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DiskBasedCache uses different inputs for file size #57
Milestone
Comments
jpd236
added a commit
to jpd236/volley
that referenced
this issue
May 31, 2018
-Previously, when new entries were written to the cache with put(), the size accounted for in those entries did not include cache overhead when actually storing them on disk. That overhead is now included. -We now prune excess entries after writing new entries to disk instead of before (so that we know the size-on-disk). This prevents the cache from exceeding the size limit due to one large entry (until the next put). The cache will now exceed the maximum size when writing an entry which pushes it over the limit; however, this excess will be cleared before put() returns rather than some indefinite time in the future. Fixes google#57
jpd236
added a commit
to jpd236/volley
that referenced
this issue
May 31, 2018
-Previously, when new entries were written to the cache with put(), the size accounted for in those entries did not include cache overhead when actually storing them on disk. That overhead is now included. -We now prune excess entries after writing new entries to disk instead of before (so that we know the size-on-disk). This prevents the cache from exceeding the size limit due to one large entry (until the next put). The cache will now exceed the maximum size when writing an entry which pushes it over the limit; however, this excess will be cleared before put() returns rather than some indefinite time in the future. Fixes google#57
@joebowbeer - I can't seem to request your review through GitHub, but if you'd like to take a look at #196, this should make things consistent around the size on disk. Rather than calculate the header size (outside of the unit tests), I instead just serialize the new entry to disk, take its size, and then prune the cache to fit afterwards. |
jpd236
added a commit
that referenced
this issue
Aug 17, 2018
-Previously, when new entries were written to the cache with put(), the size accounted for in those entries did not include cache overhead when actually storing them on disk. That overhead is now included. -We now prune excess entries after writing new entries to disk instead of before (so that we know the size-on-disk). This prevents the cache from exceeding the size limit due to one large entry (until the next put). The cache will now exceed the maximum size when writing an entry which pushes it over the limit; however, this excess will be cleared before put() returns rather than some indefinite time in the future. Fixes #57
This was referenced Mar 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Forking from #52 (comment):
Some parts of DiskBasedCache use the file size as the size of the cache entry, which includes the header overhead. Other parts use the data size which doesn't include the header overhead.
We should make this sane. Some constraints:
The text was updated successfully, but these errors were encountered: