Java: PhantomReference, ReferenceQueue and finalize
问题 I have a PR, an object O to which the PR points, and an RQ set up for PR. I have a thread which keeps on polling the RQ, and at the first reference it finds in RQ, the thread prints the time at which it found it, and exits. Things work fine, but the moment O has a finalize (no matter how trivial), the thread no longer finds a reference in RQ and keeps running indefinitely. Question: why does it happen this way? I'm using Sun JDK 1.6. Here's the code: good case public class MyGCPhantom {