I am currently playing around with a custom RocksDB
configuration in my streams app by extending RocksDBConfigSetter
interface. I see conflicting documentation around closing cache
& writeBufferManager
instances.
Right now, I see that the javadoc & one of the documentation page suggests that we need to close all the instances that extend RocksObject
(both Cache
& WriteBufferManager
instances extend this class) in the overridden RocksDBConfigSetter#close()
method.
However, the memory management documentation page suggests that we create these instances as static instances and not close the Cache
and WriteBufferManager
instances in the overridden RocksDBConfigSetter#close()
method.
Not sure what to follow here. Would appreciate if anyone can help me understand which documentation is correct and what is the preferred way if we would want to limit the memory usage by passing in a custom rocksdb configuration.
Is it ok to not close these instances if we declare them as static?