Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (855)
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 5967 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: 123
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: 123
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: 508
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  
 
 

 
EgonOlsen (1577 views)
2018-06-10 19:43:48

EgonOlsen (1662 views)
2018-06-10 19:43:44

EgonOlsen (1148 views)
2018-06-10 19:43:20

DesertCoockie (1577 views)
2018-05-13 18:23:11

nelsongames (1177 views)
2018-04-24 18:15:36

nelsongames (1668 views)
2018-04-24 18:14:32

ivj94 (2426 views)
2018-03-24 14:47:39

ivj94 (1634 views)
2018-03-24 14:46:31

ivj94 (2725 views)
2018-03-24 14:43:53

Solater (888 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!