Stalling timer -- looking for debug suggestions
I have a rather complex system that is having intermittent issues with a timer stalling.
This stalling pauses at random, and seems to last for about 3-5 minutes. After several days of testing (using logs and garbage collector output) it appears to me that during these stalls a significant portion of the JVM this jar is running in is hanging. At least, when I try to run other java applications during one of these stalls they also hang.
This error is very difficult to detect, because the counter may run for several hours before stalling, and the stall may only last for a few minutes. Also, since the stall appears (so far) to happen outside my code I haven't yet been able to find a way to specifically signal that a stall has happened in the log file. I end up watching the program operation in the background instead.
Oddly enough, I am still able to access the gui component during these pauses, and can even successfully execute updates against the database.
Now, two things to state really quick here. One, I'm expecting someone to give me "the answer" to what's wrong, just prescribe some additional debugging steps I might take to find what's going on. Two, there is quite a lot of code involved, so I'm posting some pseudo code of what the program is doing in general (so I don't have to post several files). If the information is insufficient, I'll try to be more specific in a subsequent reply on this thread.
class myMainClassextends TimerTask{
//Private attribute of my window object
//Private attribute of an OS interface that uses JNI
publicvoid run(){
System.out.println("Starting Run Pass");
//Run the JNI OS specific checks to find out what updates are needed
//Run some checks against the database
//Update the gui, if necessary
System.out.println("Ending Run Pass");
}
publicstaticvoid main(){
//Init the initial database connection
//Init new instance of the gui object (passing it db connection)
java.util.Timer timer =new java.util.Timer();
//Set up some gui listeners (closed window, etc)
//Shutdown hooks (cleans up library loads, etc)
MyMainClass classInstance =new MyMainClass();
timer.schedule(classInstance, 0, 1000);
}
}
Now, when I run it actually stalls, the log file always seems to end on a "Ending Run Pass" output. When the stall ends it immediately runs "Starting Run Pass". So I'm fairly certain that the stall isn't directly related to code occuring between those two debug statements (though I have also been looking into garbage collection in the event that too many objects are being created and destroyed).
Does anyone have any suggestions for other tests I could try to run to find out what is causing this stall?
Thanks,
marloke
Message was edited by:
marloke
(I noticed that I left a sentence unfinished)

