Here is my scenario:
I have a code that uses PersistentDictionary() which will cause the database cache to be over 3GB.
After that code is run, I want to set CacheSizeMax to 100MB to force it to dump majority of the cached data.
I do NOT want to dispose the PersistentDictionary() object, because I am going to use this same object 10 minutes later.
The only way I can see about using CacheSizeMax is from the constructor like the following (refer to this related thread
Is there a way to set it after using the dictionary without disposing it?
DatabaseConfig databaseConfig = new DatabaseConfig()
CacheSizeMax = 3 * 1024 * 1024 * 1024 / 8192; // That is 3GB
var dictionary = new PersistentDictionary<TKey, string>("myfile", databaseConfig);
// Use dictionary now...
// How to set CacheSizeMax to 100MB after using the dictionary without disposing it?