The size of memory consumed is hard to predict and depend on the configuration as well as the size and number of objects.
On each CF the dirty data (memory that has not flushed yet) may consume up to write_buffer_size multiplied by the max_write_buffers_number .
The clean data includes the block_cache and unless you set the option of cache_index_and_filter to true, which is the not the default, those blocks will be persistent in the heap.
The size of index is ruffly number of blocks multiply by the (avg key_size + 8 ); The size of filter is ruffly the number of objects multiplied by the number of objects…
If you use “cache_index_and_filter_blocks” you will suffer from somehow worse performance (about 10-15% assuming those fits into cache) but you will have a predictable cap on the size of heap memory.
There are small data structures that added to this accounting but those are very small and would not consume more than 1-2 MB of data in normal configurations .
This is basic information on where RocksDB uses memory: https://github.com/facebook/rocksdb/wiki/Memory-usage-in-RocksDB
Let me know whether it helps.
From: roc...@googlegroups.com <roc...@googlegroups.com>
On Behalf Of ???
Sent: Thursday, October 20, 2022 11:36 PM
To: rocksdb <roc...@googlegroups.com>
Subject: How to control heap usage
Hi, I am newbie in rocksdb. I tried to do some tests on rocksdb's memory usage. by set using block cache or not, modify block cache size, write buffer number, etc. . but server's memory usage did not change compared to the default settings.
ZjQcmQRYFpfptBannerStart
|
ZjQcmQRYFpfptBannerEnd
--
You received this message because you are subscribed to the Google Groups "rocksdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
rocksdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/82669af4-fadc-4015-a5af-e00d03afedc1n%40googlegroups.com.