You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a crash with MapCache while testing my app.
Reproduction
Make sure cache is at capacity (e.g. 100MB)
Scroll the map constantly for 10 sec
Then controlCapacity function constantly delete files, which is expected. However, memory usage is growing quickly without pausing, eventually leading to a crash. It's easily reproducible.
Below is a screenshot.
First peak did not lead to crash. It's because there are not enough new tiles flushing out old ones (i.e. did not scroll the map long enough). Second peak crashed.
The text was updated successfully, but these errors were encountered:
The problem lies in the excessive call to FileManager.default.contentsOfDirectory when the cache is full. DiskCache creates the ordered list of URLs in the cache over and over again for every tile to throw out. It would be better to create such a list at startup and keep it up to date during all operations. I've done that experimentally it it works quite nicely. If anybody is interested, let me know.
Hi @merlos ,
I encountered a crash with MapCache while testing my app.
Reproduction
Then
controlCapacity
function constantly delete files, which is expected. However, memory usage is growing quickly without pausing, eventually leading to a crash. It's easily reproducible.Below is a screenshot.
First peak did not lead to crash. It's because there are not enough new tiles flushing out old ones (i.e. did not scroll the map long enough). Second peak crashed.
The text was updated successfully, but these errors were encountered: