On Aug 4, 6:39 pm, Olaf Klischat<olaf.klisc...@googlemail.com> wrote:
On 08/04/2010 06:01 PM, Gene wrote:
We have a medium-sized (abuot 40,000 SLOC) Swing Desktop+JOGL app.
The JOGL part of the system draws on a GLCanvas that's on an initially
hidden tab control. The normal pattern of use is to work in the Swing-
only part of the system and then select the GLCanvas tab to visualize
work so for.
When the user selects the GLCanvas tab, there is a delay of 2 to 20
seconds while the disk clatters and all window activity freezes.
That doesn't sound normal. And why the large variance (2 to 20 seconds)?
Then
all is perfect. Afterward switching among tabs is instantaneous.
So it looks like it's binding dynamic libraries upon the first tab
click when the GLCanvas is first made visible.
Have you verified this? Try running the program in a profiler like
jvisualvm and maybe in a syscall tracer to see where the time is spent.
The system shouldn't spend two, let alone twenty, seconds linking in
some OpenGL libraries. Are you sure it's not large textures or other GL
data being loaded initially from the filesystem? Does the delay still
occur if you have empty initialization and display methods in the GLCanvas?
Thanks for the insight. I tried profiling in the Netbeans
environment. Nothing in the output indicated where the time went.
I'll look at the profilers you suggest.
The 20 seconds is on a lame, old machine with the disk deliberately
nearly full for a stress test with low swap space. The 2 seconds is
much more typical. This app has to run on computers in elementary
schools that tend to be old and slow. Hence the testing regime.
There are textures, but nearly all are tiny. The exception is a sky
map, which is ~ 1/2 megabyte in JPEG form.
Even if it is something like textures loading, the question seems
roughly the same. Textures are loaded (and reloaded) in the init()
method. Is there a way to force the GL context (including textures)
to be initialized before the first paint event causes it to happen?
Sounds like you might need to tune your JVM memory settings.
yourself.
several times. If you can set your initial heap size to just over the
peak start-up heap size, you might see start-up time improvements.