It’s becoming increasingly apparent that there isn’t sufficient understanding of how to safely common Errors, and whether they are recoverable.
As of Java 22:
- How can we safely log these errors without risking the logging operation from failing due to the JVM state?
- Does it make sense to continue operation once we get them? Or are we forced to shut down?
Specifically in the case mentioned on Reddit, even if we have one thread where OutOfMemoryError
is expected and recoverable, couldn’t it trigger OutOfMemoryError
in an unrelated thread where the error is not expected and recoverable?
- Is there a safe way to try a dangerous allocation without risking bringing down unrelated threads?