A method and system for garbage collecting managed and unmanaged memory
that is no longer referenced. The time between allocations is compared
with a threshold to determine if the garbage collector needs to collect
unused memory. Unmanaged memory referenced by objects in the unused
managed memory may be freed during the collection.