On 26/10/17 20:17, Christopher Schultz wrote:

<snip/>

> So this is relying on the OpenSSLContext.finalize() method to clean-up
> after the native SSL context?

Correct.

> It's been "recommended" to not rely on
> finalizers for quite a long time. Is that advice no longer correct?

Like most general rules there are exceptions. Arguably, this is one of
them. The alternative would require an awful lot of code to replicate
what the JVM is already doing.

I believe there are better options available in Java 9.

> I'm particularly concerned about native memory leaks.

The argument against finalizers is that they might never run as the JVM
could shutdown before they are called. In this case, that doesn't
present a problem.

We'd have a problem if an object could be GC'd without the finializer
running. I'm not aware of any scenarios where that happens.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to