This file builds on the excellent original that jason.slavick posted in the article Multi-threaded application deletion.
IIQ console ran out of heap space when I ran the original. It would try to load all of the objects of a given type into a queue, then terminate all of those objects. The queue became too large for IIQ console's heap allotment, and IIQ console would crash.
This revised version limits the size of the queue to a specified batch size. When the queue grows to the specified batch size, the code terminates the objects in the current batch. It then retrieves more objects to add to the queue. The same amount and kind of work is done in the revised version as in the original, it is just done in batches that limit how large the queue can grow at any given point.