Posted by
ctrueden on
Aug 29, 2007; 11:14pm
URL: http://imagej.273.s1.nabble.com/IJ-under-linux-performance-problem-tp3698488p3698489.html
Hi Gabriel,
Unfortunately, I don't have time to test ImageJ + Java 1.6 under Linux
right now, but one thing I can think of to try is to launch ImageJ
from the command line with the run script, perform some operation that
results in excessive lag, then hit Ctrl+\ in the console window a
couple of times to receive some stack traces. These will give you a
snapshot into what the program is doing during the slowdown. I would
also suggest watching CPU usage to see if it is spiking to 100%, or
just idling, as that might shed some light on the nature of the
problem.
Once you know which lines of code are causing the problem, you can
debug things further. Though it might uncover subtle bugs in ImageJ
that you could fix, it is more likely that there is something funny
about certain API calls in 1.6 that are resulting in the slowdown. In
that case, you could work around the issue by recoding that section of
the program to avoid the problematic function calls, or you could
search the web for more information, since it is likely to be
something others have already noticed for other applications.
Good luck,
Curtis
On 8/29/07, Gabriel Landini <
[hidden email]> wrote:
> Hi,
> I think I may have mentioned if before. Running ImageJ 1.39d under opensuse
> with Java 1.6.0_02-ea I have the following performance problem:
>
> I open the mri-stack sample and convert it from stack to images (i.e. 27
> images open).
> If I do some operation on one of the images (like a Multiply by 2, or a
> Maximum filter) then IJ starts to behave very slow.
> For the Math dialog "Multiply" to appear it takes 6 seconds or so. Anything
> that shows a dialog, takes approximately this time to open.
>
> Then when I try to close the processed window, the "Save changes?" window
> takes another 5 sec to appear. However, closing the other images -which have
> not been processed and do not show a dialog- close quite quickly.
>
> The macro below works fine and reports 256 ms to close the processed image in
> my machine (P4, 2GHz).
>
> run("MRI Stack (528K)");
> run("Convert Stack to Images");
> selectWindow("mri-stack-0001");
> run("Multiply...", "value=2");
> t=getTime();
> close();
> print("time: "+getTime()-t);
>
> However doing it by hand (the first 4 lines) introduces the delays mentioned
> abovE, and it seems that the more images, the longer the delay (with 54
> images this is about 12 sec delay!). It happens every time I try.
>
> Has anybody seen this behaviour?
> Where should one start to solve this problem?
>
> Java 1.5.0 does not seem to be affected, but there are some advantages in
> using 1.6.0: less memory use when loading 8 bit and RGB images (so it would
> be a shame not to take advantage of it).
>
> Thanks in advance.
>
> Gabriel
>