I participated in adding plugin support to my existing web application using the OSGi platform. Based on my experience and reading this topic, I realized:
1) OSGi are the most famous and highly supported Plugin standards on the JVM. There are several different implementations of this specification, such as Equinox (eclipse), Felix (Apache), Dynamic Modules (Spring), etc. So this is what most of the open source work is behind.
2) There is nothing in the specification that speaks of resource limitations. In fact, they actively avoided talking about it. Itβs not like they donβt know about it, but their position in the JVM, you canβt do anything to prevent people from doing any harm. So, the gold standard of the plugin specification on the JVM does not say that.
There are bits and pieces of information (for example, links that you posted) on how to implement some of these restrictions, but you cannot do anything in terms of preventing malicious plugins from doing bad things.
This means that there are not all ways to stop resources from hanging (CPU, memory, file descriptors, SQL connections, etc.).
The heap and processor are simple. How about just "System.exec (" rm -rf ")? Or open allows you to speak 64,000 sockets and potentially stop being able to create any new sockets.
There are so many ways that can go wrong that trying to create an in-process sandbox for plugins JVM is almost impossible.
Pavan source share