DicomObjects.NET.V8
DicomObjects Namespace / DicomGlobal Class / ReUseArrays Property



ReUseArrays Property
Controls whether DicomObjcts re-uses arrays to hold pixel data
Syntax
public static bool ReUseArrays {get; set;}
public:
static property bool ReUseArrays {
   bool get();
   void set (    bool value);
}
'Declaration
 
Public Shared Property ReUseArrays As Boolean
 
'Usage
 
Dim value As Boolean
 
DicomGlobal.ReUseArrays = value
 
value = DicomGlobal.ReUseArrays
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 3.5 or higher

See Also