The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



GarbageCollection


Unit:SDL_dstruct
Class:TStringArray
Declaration:procedure GarbageCollection;

For efficiency reasons the class TStringArray may leave parts of the internal buffers unused. This effect can be seen especially when re-assigning a string to an array element which is longer than the previously assigned string. While this process of re-mapping is completely transparent to the user, it may increase the memory load of the particular instance. The method GarbageCollection compresses the data structure of TStringArray thus reducing the memory load of the instance.

Hint 1: The process of garbage collection usually requires considerable computing time for large arrays, so it should not be called unless there is an urgent need for using as little memory as possible.

Hint 2: The minimum size of the data buffer is SABuffSize. Thus the method GarbageCollection is internally executed only if the currently allocated buffer size exceeds SABuffSize (i.e., NumBuffers is greater than 1).


Last Update: 2013-Mar-23