Browser part of the plugin2 attempts to run the applet in any VM that:
1) has same set of VM parameters
2) is not marked as tainted
This means that applets with default parameters will be run in the same VM.
However, as VM heap size is limited it will eventually throw OOM if too many applets will be assigned to run in this VM.
This may cause failure of more than single applet but potentailly applets running in that VM.
This is especially painfull as many applets including FX are actually leaking memory.
We really need to consider how much free heap is available before trying to launch new applet.
Possible implementation is as follows:
1) client VMs need to send estimate of available heap with heartbeat pings (e.g. using Runtime.freeMemory() to get the estimate)
2) browser VM should avoid assigning new applets to existing VM is available heap size is below some threshold, e.g. 30Mb)
and should launch new VM instead
We whould also consider applet hints on what is the minimal memory they need. they can work with default heap and therefore
they do not need to request bigger heap but this does not mean they will work with half of default heap ...