[
https://issues.apache.org/jira/browse/HADOOP-12958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15210852#comment-15210852
]
Sangjin Lee commented on HADOOP-12958:
--------------------------------------
Thanks for reporting this [~jlowe]. This is rather surprising, and we certainly
haven't encountered this (we've been running this code for a while now).
The javadoc for how a phantom reference behaves says the following:
{quote}
Unlike soft and weak references, phantom references are not automatically
cleared by the garbage collector as they are enqueued. An object that is
reachable via phantom references will remain so until all such references are
cleared or themselves become unreachable.
{quote}
In our case, the phantom reference itself becomes unreachable as a result of
the clean-up. Thus, there should be only one enqueuing/dequeuing, and at the
end of the clean-up the reference and the referent should be claimable.
The javadoc says phantom references are "not automatically" cleared by the
garbage collector, but when I tested smaller test scenarios on several JVMs,
the full GC itself seems to clear out the phantom reference before the
dequeuing runs (I'd be happy to post the test code if that would help).
Could you please try the following? Would it be possible to reproduce this with
more tracing? The flags are
{noformat}
-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintReferenceGC
{noformat}
The last one will report how the phantom references (and others) are handled by
each GC. Also, the JVM/OS version with which you saw this would be helpful.
Thanks!
> PhantomReference for filesystem statistics can trigger OOM
> ----------------------------------------------------------
>
> Key: HADOOP-12958
> URL: https://issues.apache.org/jira/browse/HADOOP-12958
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 2.7.3, 2.6.4
> Reporter: Jason Lowe
> Fix For: 2.7.3, 2.6.5
>
>
> I saw an OOM that appears to have been caused by the phantom references
> introduced for file system statistics management. I'll post details in a
> followup comment.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)