DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / ClearCaches Method / ClearCaches() Method
Example

In This Topic
    ClearCaches() Method
    In This Topic
    Clears the entire internal cache
    Syntax
    'Declaration
     
    
    Public Overloads Sub ClearCaches() 
    public void ClearCaches()
    Example
    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();
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also