DicomDataSet ds = new DicomDataSet(); // Operations that cause cacheing ds.CacheMode = CacheTypes.All; ds.Read("Compressed_Dataset.dcm"); ds.DecompressAll(); var cacheSize = ds.GetCacheSize(CacheTypes.All); // E.g. clear the cache when it meets a set threshold int maxCacheBeforeClear = 5000000; if (cacheSize >= maxCacheBeforeClear) ds.ClearCaches();