Hi Andrei,
sorry to be unclear. I'll try to summarise:
* I have a small file-based MVStore (~30MB on disk with LZW).
* For the reasons described previously I can't estimate memory size of entry values in a way that's meaningful, so instead the size reported for entry values is fixed at 1024 and the cache is made very large. The idea is that entries read from the store, and entries added to the store are never flushed from the cache, and instead we flush it manually every now and then. This should work as the dataset is far smaller than the available heap.
* This approach does work stably with 1.4.197, staying at around 150MB heap usage over a long period of many writes, reads, and deletes.
* When switching to 1.4.200 the same approach results in 800MB+ of heap usage and growing. I stopped the experiment when I started getting low heap warnings (> 90% usage).
Looking at the code for the LIRS cache, I can see it's gained weak references as you pointed out, so I now wonder if the JVM in my experiment would have taken action at some point, perhaps cleared those references and reduced heap usage. However, I'd like to understand where all that heap is going, and if I can avoid it triggering those warnings.
One thing that may be atypical in this workload is there are a *lot* of deletes, typically balanced by a lot of adds (the total data size tends to be the same over time). If those deleted entries stay in the heap, then that would definitely cause this.
Hope that's clearer.
Cheers,
Matt.