I have used google guava in our application based on weakValues like below.
CacheBuilder
.newBuilder()
.weakValues()
.concurrencyLevel(Runtime.getRuntime().availableProcessors())
.removalListener(removalListener)
.build(cacheLoader);
The removal listener is not called immediately after the cache weak value is removed. I have to clear native resource based on this and thus my program ends without releasing memory at native end. Is it a known issue?