2

I just inherited a desktop application that is under performing on simple tasks. Running jvisualvm to profile the code I noticed the method sun.awt.image.ImageFetcher.run is responsible for the majority of the time, taking over 5 seconds when displaying a simple form.

I checked the entire codebase and the only images were small png icons (< 1kb each) and the icons from awt itself, and found no reference to external images.

What could be happening here? Is ImageFetcher triggering other code (which the profiler doesn't show) or is there some reason for image loading taking this long?

BoppreH
  • 8,014
  • 4
  • 34
  • 71
  • 1
    I don't know the answer to either of your questions. OTOH they will be hard to answer given the completely undocumented nature of the `sun` classes. **Don't use them.** I would not be surprised if using the public methods fixes the delay. – Andrew Thompson Sep 16 '13 at 20:34
  • You may be encountering network latency, as suggested [here](http://stackoverflow.com/q/18775456/230513). – trashgod Sep 16 '13 at 21:14
  • @AndrewThompson The application does not use `sun` classes directly. @trashgod I'm still looking for, but I don't see any references to web resources. – BoppreH Sep 17 '13 at 20:42
  • Only one person can be notified at a time. Given I was notified, I presume that @trashgod was not.. – Andrew Thompson Sep 17 '13 at 20:49
  • Thanks for telling me, but it's still kinda far from solving the problem. I found a few classes that could theoretically connect to the internet, but they are not being called. – BoppreH Sep 17 '13 at 21:14
  • @AndrewThompson: I saw it. BopperH: it looks like the image fetcher is blocking the EDT. – trashgod Sep 17 '13 at 21:17
  • I had a similar situation (with OpenJDK 64-Bit Server VM build 23.7-b01) when a JIT compiler stopped working for no apparent reason. I guessed that UnsatisfiedLinkError and other class loading issues might be the reason and after I fixed those the JIT works stable once again. – ArtemGr Oct 11 '13 at 17:14

0 Answers0