It's not a secret anymore!
The moose likes Performance and the fly likes ClassLoader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "ClassLoader" Watch "ClassLoader" New topic


Dalia Sultana
Ranch Hand

Joined: Jul 16, 2006
Posts: 42
Hi All,

I have a Swing JFrame, which loads on a menu click. The screen is not too simple, but not too complicated either. It has 2 toolbars, a menubar, a JPanel(consisting of a JTable and a filter panel) and a right click context menu for the table. The very first time the screen is loaded, it takes forever fo it to come up. However, it's not as slow the cnsecutive times. I've put it through JProfiler and found out that the majority time is consumed by class loader. Any ideas, how to improve the performence here?

Also, is there a free good profiler that I can use with Eclipse 3.3?

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262

I have a Swing JFrame, which loads on a menu click ...

It sounds like your JFrame is not the first thing that gets loaded in your application, since you mention that it gets loaded form a user's menu click. You might consider having your starting GUI component spawn asimple background thread that calls


That way, when your user finally clicks on the menu, there's a good chance that the classloader will have already loaded the slow-loading Swing JFrame.

Fun programming etcetera!
I agree. Here's the link:
subject: ClassLoader
It's not a secret anymore!