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
Hi,
It seems that call to Resolve() with args on a scope leads to memory leak with many LightExpressions in root container`s registry. They are not being removed by Dispose() call.
[affects DryIoC.dll 3.1.0-preview-07 and master as well]
The problem is that ScopedServiceConfig used as key in resolution cache, but you are recreating it each time and it does not implement GetHashCode and Equals.. so no chance for container to reuse the cache.
Add GetHashCode and Equals and re-check, if no memory leak, then it works fine.
Thanks for your reply.
What do you mean by 'used as key' ?
The core purpose of args is to have different transient object (with different hash) every time. I would register it otherwise.
My understanding is args are one time use and should not leave any trace it the registry.
not caching resolved expression with args anymore
optimized RegisterInstance: type checks, late WithResolvedFactory call
optimized Constant expression interpretation
not caching resolved expression with args anymore
optimized RegisterInstance: type checks, late WithResolvedFactory call
optimized Constant expression interpretation
Hi,
It seems that call to Resolve() with args on a scope leads to memory leak with many LightExpressions in root container`s registry. They are not being removed by Dispose() call.
[affects DryIoC.dll 3.1.0-preview-07 and master as well]
Do you want me to look for less hacky means of testing it and to create a PR?
Are there any workarounds ?
The text was updated successfully, but these errors were encountered: