-
Notifications
You must be signed in to change notification settings - Fork 118
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
[BUG] unexpected high memory consumption with auto-clone #315
Comments
Hi @JoHohner
Correct, as of today that is the behaviour.
The reason is that auto-clone is an option that can be specified per-call: this means that when you ask for the data you can choose if you want it cloned or not, on a call-by-call basis. Because of this I store the object as normal, plus the
This is an interesting approach, which I'll look into. I need to consider consequences of that and some edge cases, but I'll give it a shot. Maybe this behaviour can be a global option (meaning, per-cache instead of per-call/per-entry). Now I'm onto the tagging feature which is a big hairy monster, but will ook into this as soon as possible. Thanks for pointing it out! |
Ah, okay. I didn't know that. So it is intentional atm.
Take your time, we have a workaround. Tagging is also something we appreciate. |
Currently we only use the in-memory cache with the auto-clone feature and message pack.
We observed a high memory consumption when using the cache so we played a bit with it. When storing serialized data in the cache instead of relying on auto-clone, the memory numbers were much lower.
So we looked into a profiler and the code and saw, that the cache still holds a reference to the original value, even after serializing it.
Is there a reason to not free the value?
My understanding is, that FusionCacheMemoryEntry.GetSerializedValue(IFusionCacheSerializer serializer) could / should set Value to null after serializing it, so the original object can be garbage collected.
The text was updated successfully, but these errors were encountered: