Which is why finalizers in Java have been officially deprecated [1] and might be removed altogether in a future release.
[1]: https://docs.oracle.com/en/java/javase/14/docs/api/java.base...
[1]: https://docs.oracle.com/en/java/javase/14/docs/api/java.base...