RocksJava and releasing ColumnFamilyOptions

25 views
Skip to first unread message

Michael Smith

unread,
Dec 8, 2024, 11:24:22 AM12/8/24
to rocksdb
Hi,

We have a Java app that creates and destroys many RocksDB databases over time, each with a number of column families. There's a slow memory leak (RSS keeps climbing) so I'm looking into how we're disposing of RocksDB objects.

I understand from https://github.com/facebook/rocksdb/pull/7428 that some of the column family shutdown is handled automatically by the RocksDB close() method. Is this the correct pattern:

1. App creates an Options object for the database

2. App creates the RocksDB object

3. App creates ColumnFamilyDescriptors, each with a ColumnFamilyOptions object

4. App uses RocksDB's createColumnFamily() method to create the column families

5. ...

6. App closes RocksDB. RocksDB.close() closes the owned column families automatically.

7. App closes the Options object

I wasn't sure if the ColumnFamilyOptions needs to be cleaned up there by the app, or if it's cleaned up when RocksDB.close() closes the column families.

Thanks,
Mike
Reply all
Reply to author
Forward
0 new messages