I'm implementing a custom map for cache, and thinking of ways to make it grow as much as memory allows (or something similar, I just don't want to set a fixed size that could turnout to be useless). I thought of
WeakReference
but some of my team advised against it. Any suggestions or takes on this matter? We target JVM and Native.