[ImageJ-devel] CPU usage

Curtis Rueden ctrueden at wisc.edu
Wed Sep 21 12:27:25 CDT 2011


Hi Grant,

Anyone else seeing the CPU usage stuck at +12% ofter opening an image in
> IJ2?  Or is it just me?
>
(Related: has anyone tried profiling the app?  I'm having trouble doing so
> in NetBeans... going to try VirtualVM next.)
>

If you run ImageJ from the command line (see
http://imagejdev.org/command-line) then press Ctrl+Pause (Ctrl+\ on
non-Windows platforms) from the command prompt, you will get a full stack
trace for all threads, which will be enlightening as to the cause.

I just tested on my machine here and am seeing 100% CPU usage (of one CPU)
on my system, after opening Blobs.

The stack trace reveals that there is a recursive loop going on with the
options synchronization. Relevant portion is:

    at imagej.event.EventService.publish(EventService.java:72)
    at imagej.event.Events.publish(Events.java:61)
    at imagej.ext.options.OptionsPlugin.run(OptionsPlugin.java:116)
    at imagej.ext.plugin.PluginModule.run(PluginModule.java:163)
    at imagej.ext.options.OptionsService.setOption(OptionsService.java:178)
    at imagej.ext.options.OptionsService.setOption(OptionsService.java:153)
    at imagej.legacy.patches.PrefsMethods.set(PrefsMethods.java:90)
    at ij.Prefs.set(Prefs.java:455)
    at ij.Prefs.set(Prefs.java:461)
    at
imagej.legacy.OptionsSynchronizer.arrowOptions(OptionsSynchronizer.java:171)
    at
imagej.legacy.OptionsSynchronizer.updateIJ1SettingsFromIJ2(OptionsSynchronizer.java:82)
    at imagej.legacy.LegacyService.updateIJ1Settings(LegacyService.java:143)
    at imagej.legacy.LegacyService$2.onEvent(LegacyService.java:194)
    at imagej.legacy.LegacyService$2.onEvent(LegacyService.java:190)
    at
org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
    at
org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:904)
    at imagej.event.EventService.publish(EventService.java:72)
    at imagej.event.Events.publish(Events.java:61)
    at imagej.ext.options.OptionsPlugin.run(OptionsPlugin.java:116)
    at imagej.ext.plugin.PluginModule.run(PluginModule.java:163)
    at imagej.ext.options.OptionsService.setOption(OptionsService.java:178)
    at imagej.ext.options.OptionsService.setOption(OptionsService.java:153)
    at imagej.legacy.patches.PrefsMethods.set(PrefsMethods.java:90)
    at ij.Prefs.set(Prefs.java:455)
    at ij.Prefs.set(Prefs.java:461)
    at
imagej.legacy.OptionsSynchronizer.arrowOptions(OptionsSynchronizer.java:171)
    at
imagej.legacy.OptionsSynchronizer.updateIJ1SettingsFromIJ2(OptionsSynchronizer.java:82)
    at imagej.legacy.LegacyService.updateIJ1Settings(LegacyService.java:143)
    at imagej.legacy.LegacyService$2.onEvent(LegacyService.java:194)
    at imagej.legacy.LegacyService$2.onEvent(LegacyService.java:190)
    at
org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)

Barry is out today but I will investigate this afternoon and hopefully have
a fix soon.

-Curtis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110921/c6343a93/attachment.html>


More information about the ImageJ-devel mailing list