Class MemoryConsumers
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
The databases and caches a memory snapshot should cover.
public sealed class MemoryConsumers : RocksDbHandle, IDisposable
- Inheritance
-
MemoryConsumers
- Implements
- Inherited Members
Remarks
Build one of these, add what you care about, then take an ApproximateMemoryUsage from it.
Methods
Add(Cache)
Includes a cache's memory in the snapshot.
public MemoryConsumers Add(Cache cache)
Parameters
cacheCache
Returns
Remarks
RocksDb keeps a raw pointer to the database, so it must still be open when the snapshot is taken.
Add(RocksDb)
Includes a database's memory in the snapshot.
public MemoryConsumers Add(RocksDb db)
Parameters
dbRocksDb
Returns
Remarks
RocksDb keeps a raw pointer to the database, so it must still be open when the snapshot is taken.
Create()
Creates an empty collection.
public static MemoryConsumers Create()
Returns
DisposeHandle()
Releases the native handle. Called during disposal.
protected override void DisposeHandle()
Remarks
Protected rather than public: it destroys the native object without marking this instance disposed or clearing the handle, so calling it from outside and then disposing normally would free the same pointer twice. It was the most Dispose-looking member on the type. Callers want Dispose().