Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  separate_jvm for Applets  (Read 5086 times)
0 Members and 1 Guest are viewing this topic.
Offline Hansdampf

Senior Devvie


Projects: 3


too offending?


« Posted 2011-03-20 11:08:23 »

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:
http://stackoverflow.com/questions/1461807/using-separate-jvm-to-start-applet-in-individual-jvms-not-always-working

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...)?

lots of sillystupid games: http://www.emaggame.com
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 15


★★★★★


« Reply #1 - Posted 2011-03-20 11:48:05 »

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

<PARAM name="separate_jvm" value="true">
<PARAM name="java_arguments" value="-Xmx128m">

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).
Offline Hansdampf

Senior Devvie


Projects: 3


too offending?


« Reply #2 - Posted 2011-03-20 12:18:50 »

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.

lots of sillystupid games: http://www.emaggame.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zammbi

JGO Coder


Medals: 4



« Reply #3 - Posted 2011-03-20 12:34:34 »

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.
Doesn't work for me and crashes the previous open one.

Current project - Rename and Sort
Offline Hansdampf

Senior Devvie


Projects: 3


too offending?


« Reply #4 - Posted 2011-03-20 12:37:37 »

as you can see:
1  
2  
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)

lots of sillystupid games: http://www.emaggame.com
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 15


★★★★★


« Reply #5 - Posted 2011-03-20 13:24:56 »

just a quick observation I noticed that your first <applet> tag is missing the closing '>' bracket which could be the reason the separate_vm tag isn't registering.
1  
2  
3  
4  
5  
6  
<applet width="960" height="600"
code="gamecow.collectionplayer.CollectionPlayerStarter"
archive="small.jar"
MAYSCRIPT
codebase="."
<param name="separate_jvm" value="true" />

Offline Hansdampf

Senior Devvie


Projects: 3


too offending?


« Reply #6 - Posted 2011-03-20 14:00:20 »

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

lots of sillystupid games: http://www.emaggame.com
Offline BatKid

Senior Newbie





« Reply #7 - Posted 2011-03-23 15:32:32 »

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.

Learn Java in 3D with env3d
Offline ra4king

JGO Kernel


Medals: 506
Projects: 3
Exp: 5 years


I'm the King!


« Reply #8 - Posted 2011-03-23 18:13:04 »

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.

Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (149 views)
2017-09-30 02:57:34

theagentd (222 views)
2017-09-26 18:23:31

cybrmynd (301 views)
2017-08-02 12:28:51

cybrmynd (288 views)
2017-08-02 12:19:43

cybrmynd (297 views)
2017-08-02 12:18:09

Sralse (291 views)
2017-07-25 17:13:48

Archive (978 views)
2017-04-27 17:45:51

buddyBro (1102 views)
2017-04-05 03:38:00

CopyableCougar4 (1678 views)
2017-03-24 15:39:42

theagentd (1430 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!