Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
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  
  Incremental Garbage Collection  (Read 1818 times)
0 Members and 1 Guest are viewing this topic.
Offline ecurtz

Senior Newbie





« Posted 2003-10-29 14:55:42 »

This seems to be one of those things everybody knows, but I can't find any real documentation on it.

Is there a way to turn on incremental garbage collection in my applet other than through the plugin control panel? It seems to me that the answer is "no." Why can't I do this? Or, if I can, how do I do it?

Thanks, I'm starting to get this stuff figured out,
- eli
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2003-10-29 15:26:17 »

No.

Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #2 - Posted 2003-10-29 20:18:27 »

You could consider using java web start instead of creating applets. You will be able to select the gc type you need plus everything else you can't do in an applet  Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2003-10-30 04:06:24 »

Quote
You could consider using java web start instead of creating applets. You will be able to select the gc type you need plus everything else you can't do in an applet  Smiley


You can???  when did they add this to JNLP?  I thought all you could change was the default memory sizes.  In fact I think there is a bug requesting access to more VM options just for things like this.

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2003-10-30 11:24:31 »

Actually I've been doing some rooting about: try setting

-Dhotspot.vm.args=-Xincgc

in the JNLP and see what it does...

JNLP syntax:
 <property key="hotspot.vm.args" value="-Xincgc" />
It probably won't work... but you never know. And it almost certainly won't be changeable at runtime.


Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #5 - Posted 2003-10-30 12:20:53 »

Quote
You can  when did they add this to JNLP?  I thought all you could change was the default memory sizes.  In fact I think there is a bug requesting access to more VM options just for things like this.


Well, in my old Duke Rogers game, I have this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
  <resources> 
    <j2se version="1.4+"/>
    <property name="sun.java2d.ddscale" value="true"/>
    <property name="sun.java2d.noddraw" value="false"/>
    <property name="sun.java2d.ddoffscreen" value="true"/>
    <property name="sun.java2d.d3d" value="true"/>
    <jar href="DukeRogers.jar"/>
    <jar href="Mus1.jar"/>
    <jar href="Gfx.jar"/>
    <jar href="Sfx.jar"/>
  </resources>

and that definitely works (I checked).

I kind of assumed setting the properties like Cas described would work too, but I must confess I haven't tried...

Erik

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #6 - Posted 2003-10-30 12:58:00 »

Setting properties and changing VM flags are completely different.  See the JNLP spec for how you set the heap size for example.  (Hint, not with properties.)  Something similar is needed for GC options and such.

I haven't tested it, but I think the hotspot.vm.args property is set from the other VM flags, it is not read by the VM.  I would love to be wrong about that though.

Remember that those properties you mentioned are used by Java code - NOT the VM.

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #7 - Posted 2003-10-30 13:05:14 »

Quote
Remember that those properties you mentioned are used by Java code - NOT the VM.


Hm. You have point there.
Sorry, I was too quick with my assumptions  :-/

Quote
In fact I think there is a bug requesting access to more VM options just for things like this.


I guess I'll have to vote for that bug  Smiley

Offline ecurtz

Senior Newbie





« Reply #8 - Posted 2003-10-30 14:28:38 »

Yeah if it was a property I could just set it - in fact although it does appear in javaplugin.jre.params, setting that to "-Xincgc" doesn't work (obviously no big surprise, but it was worth a shot.)

Is there any explanation from Sun about why we can't do this? I know, "their normal garbage collection is so good that I'll never see pauses unless I'm creating too many transitional objects and it's all my fault for bad coding practices." (My code ain't pausing for 2 tenths of a second to collect up 100k of RAM it doesn't need.)

It seems trivial to do, and it would improve the apparent performance of a whole range of programs.

What's the bug number? I haven't found it...

- eli
Offline Smoke

Senior Newbie




games rock!


« Reply #9 - Posted 2003-10-30 14:37:15 »

Hmmm platfrom independant, but to set some of the most important parameters for performance you need shell scripts or batch files or whatever? Cry

Well now that we get a timer that deserves his name, i got 3 free bug votes   Cheesy

Or were there any official statements how that stuff should work, or what you are supposed to do to select gc-type for the end-user?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #10 - Posted 2003-10-30 16:21:18 »

http://developer.java.sun.com/developer/bugParade/bugs/4790673.html


Woot!

FIXED FOR TIGER

Offline Smoke

Senior Newbie




games rock!


« Reply #11 - Posted 2003-10-30 18:32:20 »

oh sweet. is there something similar for jars on the horizon?

or a rfe for gc tuning with jars?
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #12 - Posted 2003-10-31 07:55:20 »

Quote
oh sweet. is there something similar for jars on the horizon?

or a rfe for gc tuning with jars?


For running an app in a jar, use vm options to tune the gc. Tuning the gc is very specific to the used vm, so using vm options makes sense.

Erik

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (16 views)
2014-07-30 21:08:39

Riven (22 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43
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!