You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing a strange memory leak issue with LRUCache. When LRUCache capacity is set as 8MB, then process's memory space remain constant and does not grow with time. When LRUCache's capacity is set > 8MB then process's memory space slowly grows and is ultimately killed by OS.
DB used for testing
DB already has 650M rows where each row's key is around 20 bytes and value averaging around 250 bytes. DB operations are put and multiGet. Keys used for multi-gets are chosen in random fashion. Rocksdb is loaded as part of JAVA process and DB operations are accessed through JNI layer. Cache is not exposed through JNI layer and default cache used by rocksdb is used.
Cache testing
Default cache of rocksdb (8MB capacity) is used and process's memory size remains constant.
When cache size is bumped up to say 512MB, process's memory space slowly grows and is finally killed by OS. Cache capacity was bumped up by changing db/db_impl.cc:
result.block_cache = NewLRUCache(67108864);
Please note that between 1) and 2), there were no changes in code other than increasing cache capacity.
Can someone please comment if they have seen this behavior? Thanks.!
PS: I am using latest code of rocksdb from github repo. Other options used for creating DB:
At first, i thought that you have a sign-extension problem with the parameter that you are passing to NewLRUCache, where you are specifying a v v large size for the cache. But maybe not.
Can you pl send me the first 500 lines of your log file (named LOG)? It will list the configs that the DB is using.
Activity
dhruba commentedon Dec 9, 2013
This is very interesting.
At first, i thought that you have a sign-extension problem with the parameter that you are passing to NewLRUCache, where you are specifying a v v large size for the cache. But maybe not.
Can you pl send me the first 500 lines of your log file (named LOG)? It will list the configs that the DB is using.
ankgup87 commentedon Dec 10, 2013
Hi Dhruba,
Thanks for following up on this issue. I actually found a memory leak in JNI layer (will update JNI repo with fix).
Will close the issue. Thanks again and apologies for raising a false alarm :)
Merge pull request meta#27 from spacejam/tyler_cf
iterator: Start on correct value when reverse=true
Revert "Add CompressedSecondaryCache into stress test" #10442 (#10509)
Fix the memory leak in db_stress tests that are caused by `FaultInjec…
Bump to v6.6.4 and apply Pegasus changes (meta#27)
Only flush after recovery for retryable IOError (#11880)
Only flush after recovery for retryable IOError (meta#11880)
Patch 8.6.6 (#11886)
Only flush after recovery for retryable IOError (meta#11880)
Fix AddressSanitizer container-overflow
Fix AddressSanitizer container-overflow
Fix AddressSanitizer container-overflow (#12722)
Fix AddressSanitizer container-overflow (meta#12722)
Revert "Add CompressedSecondaryCache into stress test" meta#10442 (me…
Fix the memory leak in db_stress tests that are caused by `FaultInjec…
Only flush after recovery for retryable IOError (meta#11880)
Fix AddressSanitizer container-overflow (meta#12722)