-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
In-Memory cache fills up indefinitely by default #40
Comments
Hey - been planning on updating the caching stuff eventually to have configurable expiration periods for each type + some eviction policy. Haven't gotten around to it yet. For now you can just set the datastore to a new instance of Cache to clear it. |
After almost two years we finally get to close this issue. This was fixed / added over a series of recent commits. Some details: The data sinks now support expiration timeouts! I.e. you can specify how long you want data to "live" in the cache or diskstore. If a piece of data is accessed that has expired, it will be removed from the data sink and the data will be refreshed. Currently, data will not be removed from the data sink until it is accessed, and it's up to you as the user to remove "old" data if it's taking up too much space / memory. You can do this via one of the following two methods: The settings (available via |
Hi @jjmaldonis, I have encountered the same issue but even after doing Here is some code which I am using to reproduce the issue, I have removed all other parts which could cause memory leaks:
To get this code to work I had to wrap part of the
This was done because I got the following error:
Even after I dug around the code in the library and set the default expiration in Versions used: |
Thanks for the detailed bug report. We'll get a new release out asap to fix this. |
Right now, the in-memory cache only ever gets fuller. When pulling a lot of data from the API, this can start to be a problem. I'd propose either explicitly mentioning this and how to reset the cache in documentation, or (ideally) having a maximum size for the cache / maximum number of stored objects, with some expulsion policy (LRU?), and a sane default value to start off with (but this might be hard to do properly).
The text was updated successfully, but these errors were encountered: