Hi,
I’m not sure if this is the right place to post a message like this, but I’m out of ideas.
I have a problem with an application I am developing, it’s fairly complex with the possibility of having many windows open at once. Some may be drawing vector graphics some may be using raster graphics some may just be displaying ordinary swing components, all updating at the same time.
The problem seems to be that very occasionally when one of the raster windows is open, the time taken for it’s paintComponent() method goes through the roof. It suddenly jumps from taken a few tens, maybe 100 milliseconds to taking three seconds to draw a few updates. The trouble is it’s very intermittent and I’ve never managed to get it to happen when running in a profiler, so I can’t tell exactly what line is the problem (or even if it is as simple as that). The result of this is that the whole GUI becomes very unresponsive until the offending window is closed, opening it up again (which recreates it from scratch) after a couple of minutes seems to solve the problem.
The window is using MemoryImageSources and VolatileImages to draw. I think what is happening is that either there is some excessive object creation and so there is a lot of garbage collection going on, or the event queue is becoming flooded with pending events and not keeping up. The thing is, surely both of these possibilities should be reasonably reproducable.
I know it’s a long shot, but has anyone here seen anything like this before? What could cause the same code to suddenly take so much longer to execute?
Alex