www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: FireBorn on February 20, 2009, 06:47:44 am

Title: Java Game Programming Question
Post by: FireBorn on February 20, 2009, 06:47:44 am
Hi guys,

I know this forum isn't for Java in general, but I thought since so many of you are working on games, I might as well ask here.

Every once in a while, my applet will hang for a couple seconds. Then continue on fine. I can't really figure out the cause of it. I thought it was maybe a synchronization thing so I tried adding synchronized blocks, but they haven't helped.

Could it be the garbage collector? There are a lot of objects that get orphaned during the course of the game, so could this be a possibility?

Thanks,
Ken
Title: Re: Java Game Programming Question
Post by: EgonOlsen on February 20, 2009, 07:17:34 am
Could it be the garbage collector? There are a lot of objects that get orphaned during the course of the game, so could this be a possibility?
Garbage collection usually isn't noticable and it doesn't take several seconds for sure (unless your applets run on a Pentium 60 or something...). Must be something different IMHO. Do you have an example applet somewhere?
Title: Re: Java Game Programming Question
Post by: C3R14L.K1L4 on February 25, 2009, 04:02:51 pm
Why don't you check in a debugger? For instance, in eclipse (the one I use), start debugging the program, when your program appears to hang, press the pause icon on the debug perspective. Then check the threads and their callstack.