Closed lprimak closed 2 months ago
Thinking more about this, I am not sure this is going to cache things correctly. BeanProperties
is now a WeakReference
so it will most likely be cleaned out on every GC.
@markt-asf What do you think?
I am not sure that clean()
method can be avoided.
Or maybe introduce a 'Real' cache via a library of some kind?
Thought about this for 2-3 hours, made a few examples, and I came to the conclusion (again) that there is no automatic way to "scope" the cache correctly. Either it will cause unnecessary memory pressure (SoftReference) or can hang on too long (WeakReference or time/LRU-based cache)
The only way to correctly invalidate this cache is to have a clearProperties()
method as in #215
I have made this PR draft, as it probably should be closed in favor of #215
…s for caching to avoid unnecessary memory pressure
Possibly fixes#214fixes#218Possibly supersedes#215