Message Board


Message Board > Java > Misunderstood!

July 23, 2005, 14:01
Frimkron
Frustrated Megalomaniac
703 posts

[b][/b]
____________
#
July 23, 2005, 14:46
Woody
HEAD BLACK MAN
722 posts

False.
____________
boredome is the bitter fruit of too much routine
#
August 25, 2005, 15:24
Caspah
Gladiator
203 posts
"Java Runtime Environment 2.0 has caused a Fatal Error"
____________
"clowns to the left of me, jokers to the right. here i am, stuck in the middle with you." ~Stealers Wheel
#
August 25, 2005, 16:39
Frimkron
Frustrated Megalomaniac
703 posts

I've never witnessed that one...

But one thing I will say about writing games in Java is that you have to be very careful about memory management. The garbage collector is handy and all, but once you start creating new objects in memory all over the place, it can kick in at any time and slow the performance right down.

The only way to get a completely predictable, smooth performance is to cut new object creation right down to a minimum. In fact don't create any new objects in the main loop of your game unless you really need to. That's my advice.

By the way Casper - did I IM you last night? I think I was getting you confused with Rincewind. It was late and I was tired :P
____________
#
August 25, 2005, 16:44
Rincewind
programmer
1548 posts

Well you certainly didn't IM *me* last night. :P
____________
Personal website: http://www.loijson.com
#
August 26, 2005, 16:30
Caspah
Gladiator
203 posts
you IMed me this night. :F of course night for me is probably morning for you. and you didnt IM me last night. or last morning. since i was at school.
____________
"clowns to the left of me, jokers to the right. here i am, stuck in the middle with you." ~Stealers Wheel
#
August 26, 2005, 16:42
Frimkron
Frustrated Megalomaniac
703 posts

It was Moogle waahhahaahha
____________
#
December 22, 2005, 01:02
Rhovanion
Exterminated
666 posts
Quoting Frimkron:
I've never witnessed that one...

But one thing I will say about writing games in Java is that you have to be very careful about memory management. The garbage collector is handy and all, but once you start creating new objects in memory all over the place, it can kick in at any time and slow the performance right down.

The only way to get a completely predictable, smooth performance is to cut new object creation right down to a minimum. In fact don't create any new objects in the main loop of your game unless you really need to. That's my advice.

By the way Casper - did I IM you last night? I think I was getting you confused with Rincewind. It was late and I was tired :P
and if you program with threads? then you could handle objects asynchronously? Would that be faster, or not? plz explain.


edit: err i didn't notice it was posted half a year ago... srry :p

[Edited on December 22, 2005 by Rhovanion]
____________
#
December 22, 2005, 01:09
Frimkron
Frustrated Megalomaniac
703 posts

Quote:
edit: err i didn't notice it was posted half a year ago... srry :p
Haha don't worry about it Rhovanion - this place isn't exactly bustling. Yet.

Welcome to the site! Upload your games! Erm.. that's about all that's working here at the moment :P

Regarding your question, I'm not sure what you mean. Java has a garbage collector which runs on its own thread anyway - that's the problem really. You never know when its going to start cleaning up for you and slowing your application down.
____________
#
December 22, 2005, 10:33
Rhovanion
Exterminated
666 posts
maybe by writing your own threaded garbage collector which sets instances of your choice to "null". I dunno. Might be difficult...
____________
#
December 22, 2005, 11:47
PEader
お前はもう死んでいる
1486 posts

Using threads wont speed it up. Switching between threads is processor intensive. The problem is you can not predict when the garbage collector is going to run, so like Frim says avoid creating objects when your game is up and running or you will quickly run out of memory or have to wait. So try to reuse the objects as much as possible.
____________
I see 57,005 people.
#
December 22, 2005, 15:21
Fiona
games are terrible
-9616558 posts

Java is fun.
____________
laffo
#
August 15, 2014, 13:18
Dennis
どこかにいる
2097 posts

Quoting PEader:
Using threads wont speed it up. Switching between threads is processor intensive. The problem is you can not predict when the garbage collector is going to run, so like Frim says avoid creating objects when your game is up and running or you will quickly run out of memory or have to wait. So try to reuse the objects as much as possible.
:cry: That's why minecraft is such a heavy program.
____________
Kwakkel
#

Message Board > Java > Misunderstood!

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!