DicomObjects.NET8 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 Boolean
    'Usage
     
    
    Dim value As Boolean
     
    DicomGlobal.ReUseArrays = value
     
    value = DicomGlobal.ReUseArrays
    public static bool ReUseArrays {get; set;}
    public:
    static property bool ReUseArrays {
       bool get();
       void set (    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: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also