NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #802 (new defect)

Opened 2011-10-04T13:48:54-05:00

Last modified 2013-06-10T14:47:38-05:00

Imglib can hang up when memory is low

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b8-analysis
Component: ImgLib2 Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1403

Description

Run IJ2 and open Boats. Now repeatedly Add Axis and choose axis size as 256. The number is not significant - other choices fail too. After as few as two iterations Add Axis fails. This is because memory runs low. IJ2 gets stuck in an imglib call. Its in the factory.create() code of RestructureUtils::createNewImgPlus() and it never returns.

Change History

comment:1 Changed 2011-10-05T11:52:43-05:00 by bdezonia

Also may manifest itself as #746

comment:2 Changed 2011-10-11T14:47:21-05:00 by bdezonia

Tried to duplicate with a stub program that only uses imglib code and cannot reproduce the problem. Factory create exceptions out with an out of memory exception like one would want.

comment:3 Changed 2011-10-13T10:49:16-05:00 by bdezonia

This issue happens if you create a new 20k x 20k image too.

comment:4 Changed 2011-10-14T13:39:30-05:00 by bdezonia

Ignore last comment. That issue is probably bug #825.

comment:5 Changed 2011-11-30T11:24:06-06:00 by bdezonia

Debugging this is puzzling. Imglib code looks fine. No exceptions being caught. The debugger seems to switch threads and is in the middle of a FutureTask thread where it is stuck. This might be a Java bug of some kind.

comment:6 Changed 2012-02-27T11:00:58-06:00 by curtis

  • Milestone changed from imagej-2.0-beta1 to imagej-2.0-beta2

comment:7 Changed 2012-05-14T10:50:13-05:00 by bdezonia

  • Blocking 1070 added

comment:8 Changed 2012-05-22T13:46:13-05:00 by bdezonia

Note that this is easy to trigger when run from Eclipse (not getting a lot of memory from launcher).

comment:9 Changed 2012-06-08T10:45:34-05:00 by bdezonia

  • Blocking 1170 added; 1070 removed

comment:10 Changed 2012-07-12T10:57:17-05:00 by bdezonia

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

comment:11 Changed 2012-08-14T12:18:29-05:00 by bdezonia

  • Blocking 1170 removed

comment:12 Changed 2012-08-14T13:45:56-05:00 by bdezonia

  • Blocking 1403 added

comment:13 Changed 2012-08-16T12:27:33-05:00 by bdezonia

I found a similar issue that I fixed in the SamplerService (#1374). If you call ImgPlus::initializeColorTables() with a large enough number Imglib gets stuck too. Again trying to allocate a lot of memory. A Future Task is spawned but it never returns. We need to find why exceptions aren't thrown and caught in these cases.

Last edited 2012-08-16T12:28:44-05:00 by bdezonia

comment:14 Changed 2012-09-10T09:11:19-05:00 by bdezonia

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

comment:15 Changed 2012-11-07T15:04:26-06:00 by bdezonia

Yet another example of silent failures: change PrimitiveDoubleArray to allocate memory not as (top * 2) but (top + top/2). Now run StatisticsDemo on embryos (or organ of corti) and try to calc median. Nothing happens. PrimitiveDoubleArray is unable to get a hold of the ram it needs. For some reason Imglib does not throw an exception about not being able to get such ram.

comment:16 Changed 2013-06-07T16:01:19-05:00 by bdezonia

  • Milestone changed from imagej2-b7-ndim-data to imagej2-b8-analysis

comment:17 Changed 2013-06-10T14:47:38-05:00 by bdezonia

Can no longer duplicate the Add Axis hang. It just reports OutOfMemoryException.