[gclist] zillion objects and gc

David.Chung@USPTO.GOV David.Chung@USPTO.GOV
Thu, 23 Aug 2001 15:42:08 -0400


Hi

	This question is a general one. In brief: 
if you have a large number of objects, a small 
fraction of which die (very slowly), is there a 
method of automatic memory management 
(i.e., gc), which would not (1) try to copy most of 
those objects or (2) trace most of those pointers? 

	Objects here can be cyclic. 

===================================== 

	Detailed description of the question. 

	Say I have 100 M worth of objects resident 
in  memory. Most of them are not large, and their 
pointers criss-cross everywhere. 

	One characteristic of these objects is that a 
fraction of them die, be it very slowly. If you GC'ed 
these objects (via generational collector), when the 
oldest generation has to be garbage collected, the 
collector has to scan all the pointers that are boxed 
in 100 M worth of objects. This can be CPU 
intensive. 

	If you impose the condition that there are no 
cycles, then solving the preceding problem is easy: just use 
reference counting. Because reference counting 
only touches objects that are affected when a reference 
is decremented, the overall cost to the above system is low, 
even though one may have 100 M of small, pointer-filled 
objects. 

	Of course, for the problem I am considering, 
there is no guarantee that the chain of ponters 
are acyclic. 

Ji-Yong D. Chung