DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomGlobal Class / ReUseArrays Property






In This Topic
    ReUseArrays Property
    In This Topic
    Controls whether DicomObjcts re-uses arrays to hold pixel data
    Syntax
    'Declaration
     
    
    Public Shared Property ReUseArrays As System.Boolean
    'Usage
     
    
    Dim value As System.Boolean
     
    DicomGlobal.ReUseArrays = value
     
    value = DicomGlobal.ReUseArrays
    public static System.bool ReUseArrays {get; set;}
    public read-write property ReUseArrays: System.Boolean; static; 
    public static function get,set ReUseArrays : System.boolean
    public: __property static System.bool get_ReUseArrays();
    public: __property static void set_ReUseArrays( 
       System.bool value
    );
    public:
    static property System.bool ReUseArrays {
       System.bool get();
       void set (    System.bool value);
    }
    Remarks

    Whilst the approach to array allocation pushed by Microsoft is "don't worry about it, just leave all memory management to the garbage collector", the reality is very different, and in practice, especially for "large" objects (>85kbytes - small by pixel standards)fragmentation can occur after prolonged use, leading to performance issues and even, on some systems, memory allocation failure, even when sufficient total memory should be available.

    As of V8 therefore, DicomObjects attempts to "re-use" pixel arrays where possible, which it does by intercepting their release, and then adding them to a cache list, from which new allocations can be made if an array of sufficient (including possibly larger) size is available. The use of over-sized arrays can be prvented by use of the ReuseOnlyExactArraySize property.

    If this property is set to false, then arrays are not re-used at all.

    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also