separate_jvm for Applets

EDIT: problem solved, my applet tag was broken. My fault! Java separate_jvm rocks!

Is there a trick to make it work?

Constructing the Applet tag with Javascript and inject some random arguments?
I don’t want to care about static objects in my code, I want the browser to start a fresh VM when the user hits reload.

here is link that describes the problem better:

how do you (if you care about Applets…) solve that problem?
How can I increment the -Xmx value by one per page refresh (If that should work…)?

There should be no real trick to it as long as the applet is started with the following in the applet tag:

Each memory setting should be specific to the individual applets. You’ll also notice each separate jvm will have its own java system tray icon (only on Windows) and java console.

Just make sure your using java plugin2 (Java 1.6.0_10+) on windows, linux and at least Java 1.6.0_14+ on Mac OSX (with out of process applets enabled).

But it does not work…
You can try the link in my sig. Sometimes a new VM starts, most times not.
One simple prove is that I keep a static counter which increases.

[quote]But it does not work…
You can try the link in my sig. Sometimes a new VM starts, most times not.
One simple prove is that I keep a static counter which increases.
[/quote]
Doesn’t work for me and crashes the previous open one.

as you can see:

2011-03-20 13:32:31.0  PLAYERSTART 10.71 0.029 a used:91.01 max:296.25 cores:8 Windows 7
2011-03-20 13:32:22.0  PLAYERSTART 1.24 1.308 a used:17.87 max:296.25 cores:8 Windows 7

2 subsequent starts, the first value is the running time in seconds. After 10 seconds the user hit refresh.
First mem usage was 17.87, second time it was 91.01
edit: the second value is the startup time (0.029 seconds for the second start after page refresh)

just a quick observation I noticed that your first tag is missing the closing ‘>’ bracket which could be the reason the separate_vm tag isn’t registering.

<applet width="960" height="600"
code="gamecow.collectionplayer.CollectionPlayerStarter"
archive="small.jar"
MAYSCRIPT 
codebase="."
<param name="separate_jvm" value="true" /> 

Shame on me! now it works again.
Thanks a lot and sorry for wasting time!

One note on this topic, the separate_jvm parameter does not work very well on OS X – it seems to work sometimes but not others, haven’t had a chance to track it down yet.

You need at least Java 1.6.0_14 for separate_jvm to work.