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

Excessive memory consumption #8

Open
malerba118 opened this issue Apr 9, 2019 · 0 comments
Open

Excessive memory consumption #8

malerba118 opened this issue Apr 9, 2019 · 0 comments

Comments

@malerba118
Copy link
Owner

Problem: Applications that load large amounts of data in a paginated manner could end up with large entity stores if no hard page refresh occurs. This is not necessarily a performance concern as entities are stored in an indexed data structure so lookups are fast, but it could lead to a big memory footprint.

Potential Solution: The only way currently to update the entities state is via the mergeEntities method, which does not provide a way to clear entities. The simplest solution to clearing old entities is to provide a database method void clear() that would reset the entity and query stores back to their initial (default) state. The developer could call this method periodically to ensure their entity/query stores do not get too big.
An ideal time to call this method would be on route changes, because in theory any route could be an entrypoint to the app, at which point the stores would be empty anyway. For this reason, calling clear on route changes would be natural and would not cause any unexpected behavior because the application should already be set up to handle an empty store at these times. I propose there should just be one clear method as opposed to clearEntities and clearStoredQueries, because i can't picture a use case where one would be called without calling the other.

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

No branches or pull requests

1 participant