Ticket #1089 (closed defect: moved)

Opened 5 years ago

Last modified 5 years ago

Options - Memory & Threads inaccurate

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b10-compatibility
Component: Plugins Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1458

Description

When you launch IJ2 when no ImageJ.cfg file exists (or no memory constraint exists within it) the dialog shows 256 mb. But the actual ram allocated might differ substantially depending upon how IJ2 was launched. Have the dialog default to the currently allocated number of megabytes. Also warn user that memory setting won't apply if they launched IJ2 by some method other than the launcher. We can detect this state via lookup of the property ij.executable that the launcher sets.

Change History

comment:1 Changed 5 years ago by bdezonia

Chat log notes:

bdezonia
dscho: if there is no ImageJ.cfg how much ram does the launcher give to IJ2? When I run it it gets 6400 mb. When you look at Options Memory & Threads it defaults to 256 when not found in ImageJ.cfg. It should probably default to that which is currently allocated. Just curious where 6400 mb came from.

2:33
dscho
bdezonia: it tries 2/3 of the available memory.

2:34
bdezonia
okay. thanks. I think I'll update the memory options dialog to default to the amount currently allocated. it will be less confusing for users

2:34
dscho
 https://github.com/imagej/imagej/blob/master/core/launcher/src/main/c/ImageJ.c#L3140
Yep.

2:34
ctrueden
bdezonia: The only way to make it appear correctly in the UI will be to call Runtime.getRuntime().maxMemory() and use that value.

2:34
ctrueden
And even then, it will be off by a few megs.

2:34
dscho
It will.

2:35
ctrueden
That is, the number you give with "-XmxABCm" will not match what maxMemory() returns... not quite.
And it is different on different platforms (sometimes off by 8MB, sometimes by 10 or 12...)

2:35
dscho
If you absolutely want, we can teach the ImageJ launcher to set a property to the memory option.

2:35
ctrueden
That's a good idea.

2:35
dscho
But that may fail if 1) the ImageJ launcher was not used to start or 2) the user plays games with setProperty().

2:35
ctrueden
Yes, #1 is the biggest concern.
Users playing games with setProperty get what they deserve.
For #1, we can fall back to maxMemory() again.
But it's rather silly to bring up that dialog when running from Eclipse, since it will not use the changed value on restart anyway.

2:36
dscho
Actually, bdezonia, you may want to check whether the property ij.executable was set in the Memory dialog, and warn the user that the setting might not have an effect due to ImageJ not being launched by the ImageJ launcher.

comment:2 Changed 5 years ago by bdezonia

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4

comment:3 Changed 5 years ago by bdezonia

  • Blocking 1339 added

comment:4 Changed 5 years ago by bdezonia

  • Blocking 1458 added; 1339 removed
  • Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0-beta5

comment:5 Changed 5 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta6 to imagej-2.0.0-beta7

comment:6 Changed 5 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta7 to imagej-2.0.0-beta9

comment:7 Changed 3 years ago by curtis

  • Status changed from new to closed
  • Resolution set to moved
Note: See TracTickets for help on using tickets.