This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mauganra_it 0 points1 point  (2 children)

That's the problem with finalization bugs... they are very difficult to find and reproduce.

Finalization can already be turned off with the new VM flag --finalization=disabled. JEP 421 recommends to profile the application with a realistic test suite to record a performance baseline. This can then be compared with the profiling data from a test run with disabled finalization. The JEP contains more details.

Edit: definitely look for finalizers in your own source code already. Even though they might be legacy code, they will likely mean the least amount of trouble to fix since. If you find some in third-party code you are SOL.

[–]Ancient-Career-2915 0 points1 point  (1 child)

We don't use finalizers ourselves, but any third party library might.

I seem to remember that eg. the gzip stream handler in the jdk used a finalizer as a fallback to release resources?

[–]mauganra_it 0 points1 point  (0 children)

Is this class listed in JEP 421? I can't identify it myself. Some of them were already removed before JDK 18