Is there a way (other than to run the plugin from a separate jvm instance) to prevent a java plugin from crashing the jvm by intentionally/unintentionally eating up the heap and causing an OutOfMemoryException?
I have a mission critical app, and wrote a new feature (plugin) that queues up user requests. For now I’ve limited the size of the queue, but want to protect the app from malicious/careless programmers that may either remove the size bound on the queue or simply inject code that creates lots of objects to cause an OutOfMemoryException.
The only way to protect yourself for poorly behaving, buggy or crashing applications is to run it in a separate JVM and communicate with it via messages, rmi or sockets.