Garbage Collection

Started by serge_christopher, January 06, 2005, 15:33:01

Previous topic - Next topic

serge_christopher

Hi all

I am currently in the early stages of developing a game using java. I was wondering if anybody out there has had any performance issues with their games due to garbage collections being performed by the VM.

cheers

elias4444

None whatsoever. I do occasionally call System.gc() however after loading/reloading a large number of assets, just to make sure it's never a problem.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

princec


Fool Running

You do have to make sure that your engine is designed so that garbage collection is reduced to a minimum. My first engine design created a lot of objects and let the GC collect them.  The performace was horrible.  :lol:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

princec

Yeah. If you're creating more than 10kb of garbage per frame you'll likely start running into trouble.

Cas :)

Fool Running

Well, at the chance that I'll sound incompetent there was alot :oops: (and it produced a less steady framerate more than a lower framerate, which to me is just as bad :roll:)
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

princec

You can actually steady the framerate out fine even with that amount of garbage, just by carefully tuning the GC collection options. The only problem is that you a) can't do it under webstart and b) it's different for 1.4 and 1.5

Cas :)

Fool Running

I didn't think of that. :lol: That would have saved me alot of time  :wink:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

blah

Quote from: "princec"You can actually steady the framerate out fine even with that amount of garbage, just by carefully tuning the GC collection options. The only problem is that you a) can't do it under webstart and b) it's different for 1.4 and 1.5

Cas :)

I only recently discovered this, whilst making an auto-jnlp-creator, but ... if webstart will honour the tuning settings, you can handle this: it has a built in feature of allowing you to specify multiple JVM's in parallel with *unique* JVM args to each.

Just kick your local Sun rep until they allow "ANY" JVM arg (anything you could type on the command line) as valid in webstart JNLP. There is no reason not to allow this, other than that sun thinks it isn't important. Off the top of myhead, 1.4 still only supports a tiny tiny subset (3 out of 300!) and 5 supports more, but still not the full 300?

princec

I've given up asking Sun to do anything for Java.
If somebody would fund it I'd write my own Webstart that did everything correctly.

Cas :)

blah

Give me a quote, and if JGF ever makes that much money...

Perhaps some of the donation money could go towards it too.

Total income to date still hasn't broken the $2 barrier yet, LOL, but we'll wait and see what happens when the site goes live...

princec

Well, you stand to make 50% as an affiliate for all 3 of our games. That should give you a bit of an incentive to hurry up, eh?

Cas :)

gregorypierce

Quote from: "princec"I've given up asking Sun to do anything for Java.
If somebody would fund it I'd write my own Webstart that did everything correctly.

Cas :)

Smart move. I've given up on even discussing anything related to Java with them.