So, although running compactions manually does increase the memory by a small % I also tried turning the manual ones off completely and found out that the memory was still increasing at an almost constant rate.
In my app, I'm only doing read-modify-write type of operations. Earlier, I was not closing the WriteBatch object which was leading to a memory leak every time I was writing something. Not sure what is it this time.
During the reads, I only use the ColumnFamilyHandle object (which inherited RocksObject that can caused the problem during writes earlier) which is only defined once and is reused multiple times. One important thing to note here is that I'm using multi-get operations. So, with all the keys, I also have to pass on their respective ColumnFamilyHandles to the method call. In my case, it's the same handle so before the call, I just make 'n' copies of the ColumnFamilyHandle object.
I'm guessing that it should not be the problem.
I;m not using iterators. My filter and index blocks are cached in the block cache. My memtable size is 100 MB * 6.
Any suggestions please?