Memory leak in PendingFuture?

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 24 08:16:58 UTC 2014


On 24/04/2014 07:17, Zhong Yu wrote:
> In sun.nio.ch.PendingFuture, there is a static cached Throwable
>
>      private static final CancellationException CANCELLED =
>          new CancellationException();
>
> Apparently, its Throwable.backtrace field contains an array of all
> Classes on the call stack. This will prevent the user classes from
> being garbage collected.
>
I'll create a bug for this, it is an oversight that the stack wasn't 
cleared.

-Alan.


More information about the nio-dev mailing list