NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 933 - Fiji very slow boot up
Fiji very slow boot up
Status: ASSIGNED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
Macintosh Mac OS
: P4 normal
Assigned To: Curtis Rueden
: 934 1170
Depends on:
Blocks:
 
Reported: 2014-09-26 05:12 CDT by Antonio Sechi
Modified: 2015-10-21 11:18 CDT
7 users (show)

See Also:


Attachments
very slow Fiji boot up (2.45 KB, text/plain)
2014-09-26 07:31 CDT, Antonio Sechi

Description Antonio Sechi 2014-09-26 05:12:34 CDT
Hello,

In the past 2 weeks, I have noticed that Fiji takes a few minutes to start up.  By contrast, ImageJ takes about 10 sec.  Has any of you observed this bizarre behaviour of Fiji?  For your information, I run Fiji on a MBP retina, OS 10.9.5, 2.6 GHz i7, 16 GB RAM.

Thank you in advance for your reply.
Antonio

Information about your version of Java:

  os.arch => x86_64
  os.name => Mac OS X
  os.version => 10.9.5
  java.version => 1.6.0_65
  java.vendor => Apple Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_65-b14-462-11M4609
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 20.65-b04-462
  java.vm.vendor => Apple Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => apple.awt.CGraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: null
  imagej.dir => /Applications/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140916171414)
Fiji: http://fiji.sc/update/ (last check:20140920203626)
Comment 1 Johannes Schindelin 2014-09-26 06:27:49 CDT
Please take a moment to follow the steps described here: http://fiji.sc/Command-Line_Debugging, in particular http://fiji.sc/Command-Line_Debugging#Debugging_JVM_hangs to find out where Fiji is stuck.
Comment 2 Antonio Sechi 2014-09-26 07:31:59 CDT
Created attachment 216
very slow Fiji boot up

I do not understand the attached file.  Perhaps, it already indicates where the problem is located.

Thanks,
Antonio
Comment 3 Antonio Sechi 2014-09-26 07:33:43 CDT
Comment on attachment 216
very slow Fiji boot up

Last login: Fri Sep 26 11:02:05 on console
You have mail.
tee-room-p4:~ antoniosechi$ cd /Applications/Fiji.app/Contents/MacOS/
tee-room-p4:MacOS antoniosechi$ cp fiji-macosx debug
cp: fiji-macosx: No such file or directory
tee-room-p4:MacOS antoniosechi$ cp ImageJ-macosx debug
tee-room-p4:MacOS antoniosechi$ ./debug
sysctl says os_release is 13.4.0
Detected ImageJ2
Available RAM: 7402MB, using 3/4 of that: 5552MB
JRE not found in '/Applications/Fiji.app/jre'
Ignoring Apple Framework java executable: '/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java'
No JRE was found in default locations
Re-executing with correct library lookup path (/Applications/Fiji.app/lib/macosx:/Applications/Fiji.app/mm/macosx)
sysctl says os_release is 13.4.0
Detected ImageJ2
Available RAM: 7402MB, using 3/4 of that: 5552MB
JRE not found in '/Applications/Fiji.app/jre'
Ignoring Apple Framework java executable: '/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java'
No JRE was found in default locations
java -Djava.ext.dirs=/Applications/Fiji.app/java/macosx-java3d/Home/lib/ext/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext -Dpython.cachedir.skip=true -Dplugins.dir=/Applications/Fiji.app -Xmx5552m -Xincgc -XX:PermSize=128m -Djava.class.path=/Applications/Fiji.app/jars/imagej-launcher-3.1.6.jar -Dimagej.dir=/Applications/Fiji.app -Dij.dir=/Applications/Fiji.app -Dfiji.dir=/Applications/Fiji.app -Dfiji.defaultLibPath=lib/server/libjvm.dylib -Dfiji.executable=./debug -Dij.executable=./debug -Djava.library.path=/Applications/Fiji.app/lib/macosx:/Applications/Fiji.app/mm/macosx -Dij.debug=true -Dscijava.log.level=debug net.imagej.launcher.ClassLauncher -ijjarpath jars -ijjarpath plugins net.imagej.Main
JavaVMBundlerVersionsDirURL: /System/Library/Frameworks/JavaVM.framework/Versions
TargetJavaVM: /System/Library/Frameworks/JavaVM.framework/Versions/1.6
Setting JAVA_JVM_VERSION to 1.6

Sep 26 13:39:07 tee-room-p4.cellbio.rwth-aachen.de debug[1128] <Error>: The function `CGContextErase' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
ij1.plugin.dirs: null
$HOME/.plugins: /Users/antoniosechi/.plugins does not exist
Launching main class net.imagej.Main with parameters []
Class loader = sun.misc.Launcher$AppClassLoader@1feed786
Comment 4 Johannes Schindelin 2014-09-26 07:47:03 CDT
It does not look like you hit Ctrl+\. Please follow the steps indicated in http://fiji.sc/Command-Line_Debugging#Debugging_JVM_hangs
Comment 5 Mark Hiner 2014-09-26 09:57:22 CDT
I just expanded the http://fiji.sc/Command-Line_Debugging#Debugging_JVM_hangs section to hopefully make things a bit clearer.

Specifically, Antonio, it looks like you printed the debug output of launching Fiji. Johannes is asking for the stack trace, which will tell us what's going on in Java at time it was acquired. So if you acquire a stack trace while Fiji is starting up, we will hopefully get an idea of what part of the code is making it slow.

Please let us know if you have any trouble acquiring the stack trace.
Comment 6 Johannes Schindelin 2014-09-29 11:38:46 CDT
*** Bug 934 has been marked as a duplicate of this bug. ***
Comment 7 Johannes Schindelin 2014-09-29 11:40:09 CDT
It does not look like you hit Ctrl+\. Please follow the steps indicated in http://fiji.sc/Command-Line_Debugging#Debugging_JVM_hangs
Comment 8 Curtis Rueden 2015-10-13 11:05:03 CDT
*** Bug 1170 has been marked as a duplicate of this bug. ***
Comment 9 amc910 2015-10-19 09:41:41 CDT
Hi there,

I've come over from Bug 1170.

I'm having problems taking a stack trace. Pressing Ctrl+Pause/Break just seems to give me the command line back again, with no other output.

Any suggestions?

Kind regards,
Angus
Comment 10 Leon Yang 2015-10-19 16:36:10 CDT
(In reply to amc910 from comment #9)
> Hi there,
> 
> I've come over from Bug 1170.
> 
> I'm having problems taking a stack trace. Pressing Ctrl+Pause/Break just
> seems to give me the command line back again, with no other output.
> 
> Any suggestions?
> 
> Kind regards,
> Angus

Hi,

For some reason, the Ctrl+Pause/Break is not working right now. We will check what's the problem later.

Alternatively what you can try, is to find the pid of the running Fiji 
(using "ps ax | grep ImageJ" in the console, and the first number appears should be the pid). Then enter "jstack -F <pid_of_imagej>", and that should return you the stack dump.

Hopefully that can help,

Leon
Comment 11 Leon Yang 2015-10-19 17:12:09 CDT
(In reply to Leon Yang from comment #10)
> (In reply to amc910 from comment #9)
> > Hi there,
> > 
> > I've come over from Bug 1170.
> > 
> > I'm having problems taking a stack trace. Pressing Ctrl+Pause/Break just
> > seems to give me the command line back again, with no other output.
> > 
> > Any suggestions?
> > 
> > Kind regards,
> > Angus
> 
> Hi,
> 
> For some reason, the Ctrl+Pause/Break is not working right now. We will
> check what's the problem later.
> 
> Alternatively what you can try, is to find the pid of the running Fiji 
> (using "ps ax | grep ImageJ" in the console, and the first number appears
> should be the pid). Then enter "jstack -F <pid_of_imagej>", and that should
> return you the stack dump.
> 
> Hopefully that can help,
> 
> Leon

If you are using Windows, you can either enter the next line:
tasklist /fi "imagejname eq ImageJ-win64.exe"
in the console (you should change the executable name on the previous line the match the one you are using),

or go to the task manager->Processes tab->right click the bar on the top, which has "Name" "CPU" "Memory" etc.->select the PID menu item->go to the ImageJ app and look for its pid.

Please reply if there is anything unclear.

Leon
Comment 12 Leon Yang 2015-10-19 18:07:49 CDT
(In reply to Leon Yang from comment #11)
> (In reply to Leon Yang from comment #10)
> > (In reply to amc910 from comment #9)
> > > Hi there,
> > > 
> > > I've come over from Bug 1170.
> > > 
> > > I'm having problems taking a stack trace. Pressing Ctrl+Pause/Break just
> > > seems to give me the command line back again, with no other output.
> > > 
> > > Any suggestions?
> > > 
> > > Kind regards,
> > > Angus
> > 
> > Hi,
> > 
> > For some reason, the Ctrl+Pause/Break is not working right now. We will
> > check what's the problem later.
> > 
> > Alternatively what you can try, is to find the pid of the running Fiji 
> > (using "ps ax | grep ImageJ" in the console, and the first number appears
> > should be the pid). Then enter "jstack -F <pid_of_imagej>", and that should
> > return you the stack dump.
> > 
> > Hopefully that can help,
> > 
> > Leon
> 
> If you are using Windows, you can either enter the next line:
> tasklist /fi "imagejname eq ImageJ-win64.exe"
> in the console (you should change the executable name on the previous line
> the match the one you are using),
> 
> or go to the task manager->Processes tab->right click the bar on the top,
> which has "Name" "CPU" "Memory" etc.->select the PID menu item->go to the
> ImageJ app and look for its pid.
> 
> Please reply if there is anything unclear.
> 
> Leon

The command to get the pid should be this one instead:
tasklist /fi "imagename eq ImageJ-win64.exe"
Sorry for the confusion.

Leon
Comment 13 Curtis Rueden 2015-10-20 15:00:37 CDT
I updated the wiki with improved instructions for producing a stack trace, especially on Windows.

http://imagej.net/Troubleshooting#If_ImageJ_freezes_or_hangs

Unfortunately, the old way of doing it ("ImageJ-win64.exe --console --system") no longer works. In fact, the --system and --dry-run flags do not seem to work on Windows.

To work around these issues, I created a batch file which you can download and double click from here:

https://raw.githubusercontent.com/imagej/imagej/master/bin/ImageJ.bat

Save it to your ImageJ.app/Fiji.app folder, then run it from Command Prompt. You should then be able to generate a stack trace using Ctrl+Pause.
Comment 14 amc910 2015-10-21 10:55:22 CDT
So, fun developments.

I've downloaded the batch file from Curtis, saved it in the Fiji.app directory as 'Debugger.bat' and then run it from the command line. It gives:


c:\FIJI\Fiji.app>Debugger.bat

Discovered Java at:
c:\FIJI\Fiji.app\java\win64\jdk1.6.0_24\jre

Launching ImageJ.


FIJI then proceeds to launch fine and quickly (within ~15 seconds).

Closing this session, then trying to open FIJI again (not from command line, but 'normally') it again takes an age to load.


Getting the PID of FIJI worked fine, but 'jstack' seems not to be a recognised command in the Windows command line.

Any more information I can give, please let me know.

Kind regards,
Angus
Comment 15 Curtis Rueden 2015-10-21 11:01:43 CDT
Thanks for the update!

The fact that the batch file does not illustrate this problem strongly suggests that this issue is specifically related to the ImageJ native launcher somehow.

The good news is: we are planning to retire that launcher soon in favor of JavaFX-packaged application bundles. It is likely (but not certain) that those will not have suffer from the same problem.

The bad news is: it will be a couple more months (at least) before that transition can be completed. In the interim, you could use that batch file to avoid the issue, although you probably want to edit it to (at minimum) add "-Xmx2g" for however many gigs of memory you want ImageJ to use.

I am assigning this issue to myself, and will follow up as soon as we have a new application bundle for you to test out.
Comment 16 amc910 2015-10-21 11:18:24 CDT
Thanks Curtis, I'll keep an ear open.

Angus