Memory leak when providing a block cache in rocksdb java

31 views
Skip to first unread message

krishan goyal

unread,
May 29, 2025, 6:01:49 AMMay 29
to rocksdb

Hi,

We have noticed a memory leak when we supply a block cache in rocks db java. Using 10.2.1 rocks db version.

We have opened an issue https://github.com/facebook/rocksdb/issues/13645 which has the reproducible code 

Observations on running this program -

  1. The process RSS memory increases and doesn't come back down after all resources are closed. The memory isn't reclaimed if we force a GC too. The process's RSS memory ~= block + row cache size after all resources are closed and GC is forcefully run .
  2. Tested by running with jemalloc too and the leak remains so it shouldn't be a fragmentation problem.
  3. The memory isn't reclaimed if other processes require it. Running the same java program repeatedly results in an OOM.
  4. Strangely, there is no memory leak in macOS. The RSS memory increases during the execution but comes back down to baseline (~50 MB) after the resources are closed. So the memory leak exists on linux.

Can someone confirm if there is an actual rocks db java bug or if my code needs to handle the block cache closure differently ? 

Thanks
Krishan
Reply all
Reply to author
Forward
0 new messages