LWJGL Forum

Programming => General Java Game Development => Topic started by: serge_christopher on January 06, 2005, 15:33:01

Title: Garbage Collection
Post by: serge_christopher on January 06, 2005, 15:33:01
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
Title: Garbage Collection
Post by: elias4444 on January 06, 2005, 15:57:42
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.
Title: Garbage Collection
Post by: princec on January 06, 2005, 17:53:44
No.

Cas :)
Title: hmmmmm...
Post by: Fool Running on January 07, 2005, 14:13:59
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:
Title: Garbage Collection
Post by: princec on January 07, 2005, 14:59:47
Yeah. If you're creating more than 10kb of garbage per frame you'll likely start running into trouble.

Cas :)
Title: hmmmmm...
Post by: Fool Running on January 10, 2005, 14:32:23
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:)
Title: Garbage Collection
Post by: princec on January 10, 2005, 15:19:43
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 :)
Title: hmmm...
Post by: Fool Running on January 11, 2005, 14:20:43
I didn't think of that. :lol: That would have saved me alot of time  :wink:
Title: Garbage Collection
Post by: blah on January 15, 2005, 12:11:01
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?
Title: Garbage Collection
Post by: princec on January 15, 2005, 12:37:22
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 :)
Title: Garbage Collection
Post by: blah on January 15, 2005, 12:49:44
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...
Title: Garbage Collection
Post by: princec on January 15, 2005, 12:51:30
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 :)
Title: Garbage Collection
Post by: gregorypierce on January 21, 2005, 01:28:55
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.