DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / GetCacheSize Method
Type of Cache of interest, default value is DicomObjects.Enums.CacheTypes.All
Example

In This Topic
    GetCacheSize Method (DicomDataSet)
    In This Topic
    Get cache size used by DicomObjects for the image - useful to help decide when to call ClearCaches method
    Syntax
    'Declaration
     
    
    Public Function GetCacheSize( _
       ByVal cacheType As CacheTypes _
    ) As System.Long
    public System.long GetCacheSize( 
       CacheTypes cacheType
    )

    Parameters

    cacheType
    Type of Cache of interest, default value is DicomObjects.Enums.CacheTypes.All

    Return Value

    number of bytes cached by DicomObjects
    Example
    DicomDataSet ds = new DicomDataSet();
    ds.CacheMode = CacheTypes.All;
    ds.Read("Compressed_Dataset.dcm");
    ds.DecompressAll();
    var cacheSize = ds.GetCacheSize(CacheTypes.All);
                        
    // Optionally Clear the Cache when it gets to large
    int maxCacheBeforeClear = 5000000;
    if (cacheSize >= maxCacheBeforeClear)
        ds.ClearCaches();
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also