How is a direct ByteBuffer released?

Just to be curious, how does the JVM know wether a direct byteBuffer can be released of no reference points to it?Is there some reference-counting magic in the background or does a full DirectMemory-Area trigger a GC?Thank you in advance, lg Clemens
[270 byte] By [linuxhippya] at [2007-11-26 14:52:20]
# 1
Cleanup of DirectBuffers is done using a subclass of PhantomReference called sun.misc.Cleaner. They are released fairly quickly once they are found and a System.gc is invoked before throwing OutOtMemoryError though there are some weaknesses in the code for managing the storage.tom
neverevera at 2007-7-8 8:40:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Thanks a lot for explaining - I'll have a look at this reference-type, seems to be very interesting.
linuxhippya at 2007-7-8 8:40:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...