Skip to content
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

Redo fragment caching to use less memory and store off-screen fragments #906

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

burgerindividual
Copy link
Contributor

This also should close #564. Copied from my comment from then:

In short, the normal FragmentCache was removed, as well as the availableQueue. Now, there are separate classes OffScreenFragmentCache and AvailableFragmentCache. The off-screen fragments have a limited lifespan of 30 seconds so they don't take up too much ram, and they are also SoftReferences so they don't cause an OOME. The AvailableFragmentCache is in place of the old availableQueue and adds some extra features. It uses SoftReferences, and they have an expiration time of 60 seconds. A thread gets spawned to clean and maintain both of these caches every half a second. The times for each cache are modifiable in the settings, and either one can be set to never get removed.

With the FragmentCache being gone, this means that no cache will have the on-screen fragments once they are all done loading. We now have to get them from the FragmentGraph instead, and it's used for when we need to invalidate a layer and put the fragments back in the loadingQueue.

Overall, it should make the fragment pipeline a bit simpler and should also use a lot less ram.

magicus and others added 30 commits October 26, 2019 00:03
* Never recycle fragments (old code is still there, but dead).
* Previously enqueued but no longer visible fragments are now still being queued to be loaded, but in the background, only after all visible but not loaded framents have been processed.
* Refactor cache handling
* Revert unneeded changes
* Add documentation
…at it's referent has not been cleared by the GC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants