Hash locks and pointer-free allocation
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Fri Dec 7 18:12:00 GMT 2001
I don't think that hash synchronization is neccessarily a prerequisite
for having pointer free objects specially allocated.
Firstly, no Java object is ever _really_ pointer-free, because of the
class descriptor (vtable) pointer. I suppose the GC assumes that pointer
free classes themselves are never GC-allocated? Thats no problem for
things like primitive arrays (and perhaps all native classes), but not
marking the vtable will prevent Class GC for classes loaded from
bytecode with a custom classloader.
Even without hash synchronization we can still have pointer free
allocation provided the "fat" synchronization info data is allocated as
uncollectable. We can free them using finalizer chaining on the monitor.
I don't think this would be much of a performance hit because "fat"
locks would only occur for contended monitors and they are very rare.
regards
Bryce.
More information about the Java
mailing list