views:

44

answers:

1

I have some untrusted client code and I want to run it by initiating a java virtual machine instance for each client to manage the max memory used by the JVM for each instance and max running time the code is allowed to execute. How can I do this ?
Is there a code sample for such a thing ?
I read about JVM pooling here and there but I couldn't understand how to do this ?
I want to see some code

A: 

Some time ago I participated in a programming contest where an algorithm had to fight against other algorithms. The site used a special JVM to limit the number of instructions you were allowed to use for your calculations in each step.

I think this is not exactly what you are looking for, because the java programs are highly restricted in the classes they can use. But since there are no other answers till now, this could be a starting point.

tangens