Dieter
Dieter

Reputation: 56

Java Applet starts up very slowly for some users?

[UPDATE: I forgot to add that this 30 sec. freezing problem only happens the first time I try to load a file from the server. Subsequent loads are very quick. Maybe some strange reverse DNS lookup? I am hosting on Google's appengine.]

I started a little project recently called http://www.chartle.net which is build around an applet.

Startup time is an important factor in the user's experience of an applet. I collect statistics and am shocked that I find often very long startup times (factor 50 to 100 higher then necessary)

The applet starts in 1-3 seconds depending on the speed of your computer and connection. Still for some users it takes up to 100 sec.

I have mixed results from my own tests. Mostly it is very fast but sometimes freezes the browser for a long time and the Java console doesn't tell me why. Best guess is, that it stalls when loading a saved chart.

Please help me figuring this out - best test by opening an already saved chart (click on one of the 'create' links at http://www.chartle.net/gallery)

Cheers, Dieter

Upvotes: 0

Views: 3118

Answers (2)

Dieter
Dieter

Reputation: 56

It may be that only the old plugin causes these problems. That means basically all people running on OSX and other users with Java prior to 1.6_update_10.

So, I would really appreciate people with such setups to watch their Java console and describe the first startup behaviour.

Cheers, Dieter

Upvotes: 1

Pool
Pool

Reputation: 12342

This is generic help rather than specific for your demo (which loaded fine for me in a few attempts).

Freezing applets

In the JDK bin directory there is a very handy programme called jstack. Refresh your browser window until it crashes and then run:

jstack *process_id*

This will give you the stack trace of any frozen Java process. If Java is not a separate process then you can use the browser's process (eg for Opera).

The following few problems were/are common for me:

  1. I reccommend you use invokeLater rather than invokeAndWait on the init method (although you can't do this if you use start/stop methods)
  2. Opera's custom java plugin acts very poorly...
  3. Deadlocks caused by synch blocks and invokeAndWait's

Slow applets

Possibly the browser is fetching resources from the server, unable to use the jar file?

Upvotes: 2

Related Questions