I have a piece of software that needs to parse large files. Limiting input or providing infinite memory is not an option, so I have to live with flying OOME. Since OOME only kills Thread, my software runs in some crap state.
Outside, everything looks fine, because the process is running, but inside it is the braindead.
I would like to put a fork on it. But how can I do this?
Catching OOME does not guarantee that the next line of code will be executed. e.g. System.exit (9). Thus, the JVM should notice OOME and destory itself.
Is their some vm option for this?
source share