Next: , Previous: , Up: Referable Objects   [Index]


4.2.7.9 Consolidated Disposal

The libaime default object disposal policy is immediate disposal. The policy dictates that objects are disposed of as soon as not needed.

While the policy delivers generally good performance with regard to CPU load and memory usage, it may at times be very slow. Especially when references are removed from objects that are part of large objects sets. The object reachabilily determination triggered by the reference removal has linear complexity over the objects set. This implies that at worst all the objects in the set are examined. All the time, a reference removal may not require an object collection (i.e. destruction), for the object may still be reachable. It easily follows that even the simplest reference tracing algorithms may have very poor performance (traversing a linked list may require L^2 object examinations, where L is the length of the list).

Consolidated disposal is an alternative collection policy that strikes a different performance balance and that may significanlty improve program execution characteristics.

The policy dictates that the reachability determination is not made when references are removed, and instead the objects are recorded with a "to be later examined" list. The reachability of the objects in the list is determined periodically in a consolidated fashion. The determination has the same linear complexity, only now is done for a large number of objects.

The consolidated disposal appears in libaime as an extension of the default immediate disposal mechanism. It reuses all of the existing infrastructure and only adds the "later" list.

More, it does not substitute the immediate disposal in the dynamics of program execution, but kicks in when the instant reachability determination reaches a certain condition (like when the number of examinated objects has reached a set threshold).

While consolidated disposal has its merits, it does require tuning and it may trade memory for CPU cycles at dismal rates.

The consolidated disposal tuning parameters include the object bail out condition at which the instant reachability determination is stopped and the condition that triggers the reachability determination for the bailed out objects.

For such reasons the mechanics of consolidated disposal need to be setup by the application and later assistance from the application is required.

The class 3 data types provided by libame libraries allow their reference management to be amended for consolidated disposal purposes.

The class is that of referable and able to store references data types, the only class interesting for consolidated disposal.

See Object Classes.

See Libraries.

See Consolidated Disposal Manager Construct.

See Consolidated Disposal Mechanics.


Next: , Previous: , Up: Referable Objects   [Index]