Link to home
Start Free TrialLog in
Avatar of olbion2
olbion2

asked on

Java applet hangs randomly in Linux; how can I identify the cause?

I have a java applet which mostly runs fine. However, when used in Linux, it sometimes hangs. The exact behaviour is this:
1. After repeating the same exact action in the applet for a number of times, the applet stops responding.
2. The browser (Firefox) still works; however, to be able to use java plugins again, Firefox must be restarted AND the java_vm process must be manually killed.
3. No errors are reported in the log files. Tracing, logging and "applet lifecycle expectations" are all enabled.
4. The java_vm takes up a lot of cpu when it hangs, so I guess that it gets stuck in a loop.

My questions:

How can I identify the problem?

Is there some way to log the activities of java in more detail so as to understand at what point the error occurs?

Is there perhaps some known "bug" - that is, some piece of java code which causes applets to hang under Linux?

I myself run Ubuntu Feisty with Java 1.5.0.11, but several Linux users have reported the same problem.

The end of my log file looks like this:
<record>
  <date>2007-10-08T19:32:16</date>
  <millis>1191864736982</millis>
  <sequence>199</sequence>
  <logger>sun.plugin</logger>
  <level>FINE</level>
  <class>com.sun.deploy.util.LoggerTraceListener</class>
  <method>print</method>
  <thread>10</thread>
  <message>redrawing boardlayer
</message>
</record>

The end of the trace file says (repeated about 15 times in all):
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
redrawing boardlayer
ASKER CERTIFIED SOLUTION
Avatar of Phil_Crusader
Phil_Crusader
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ebertk
ebertk

One more comment - start out with a small numerb of System.out's that cover the entire section of the applet that appears to be a problem.  Then create additional system.out's in your code to narrow down where the error is occuring.  You may find its either your code or part of a call to the JVM, but an iterative approach will zero in on the issue.
Did any of the ideas above work for you?