3 ms·
That's try-catch. But you missed the point: you can't do anything about fatal exceptions such as an OutOfMemoryError.
by samus 1y ago
That's try-catch. But you missed the point: you can't do anything about fatal exceptions such as an OutOfMemoryError.
- kazinator 1y agoUntrue. The circumstances of an OOM can be arranged in such a way that an emergency stash of a small amount of memory is available to meet the needs of some clean-up task.
- samus 1y agoThose stashes (and things like caches) should use SoftReferences so the GC can drop them under memory pressure. That way no funny stuff needs to happen in catch blocks.