8041772: (ch) PendingFuture.CANCELLED has backtrace that potentially keeps objects alive
Alan Bateman
Alan.Bateman at oracle.com
Fri May 2 12:14:57 UTC 2014
On 01/05/2014 01:50, Zhong Yu wrote:
> :
> It doesn't clear `Throwable.backtrace` (should it though?) so it won't
> solve the problem.
>
> Calling constructor Throwable(x,x,x, writableStackTrace=false) seems working.
>
>
That's a protected constructor. In any case, I'm not sure that it's
worth doing anything here. Cancellation and I/O are just not good
bedfellows so I don't expect that it will be used very much. Also in
normal usage then the Future will likely be in unreferenced quickly. If
there are good examples where this might be a real issue then we can of
course look at this again but I think that dropping the static field (as
has been done) is the most important thing (and I'm happy you found that).
-Alan
More information about the nio-dev
mailing list