This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Hash locks and pointer-free allocation
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: java at gcc dot gnu dot org
- Date: Sat, 08 Dec 2001 15:13:30 +1300
- Subject: Hash locks and pointer-free allocation
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.