Ticket #802 (new defect)

Opened 7 years ago

Last modified 5 years ago

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 7 years ago by bdezonia

Also may manifest itself as #746

comment:2 Changed 7 years ago 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 7 years ago by bdezonia

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

comment:4 Changed 7 years ago by bdezonia

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

comment:5 Changed 7 years ago 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 7 years ago by curtis

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

comment:7 Changed 7 years ago by bdezonia

  • Blocking 1070 added

comment:8 Changed 6 years ago by bdezonia

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

comment:9 Changed 6 years ago by bdezonia

  • Blocking 1170 added; 1070 removed

comment:10 Changed 6 years ago by bdezonia

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

comment:11 Changed 6 years ago by bdezonia

  • Blocking 1170 removed

comment:12 Changed 6 years ago by bdezonia

  • Blocking 1403 added

comment:13 Changed 6 years ago 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 6 years ago by bdezonia (previous) (diff)

comment:14 Changed 6 years ago by bdezonia

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

comment:15 Changed 6 years ago 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 5 years ago by bdezonia

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

comment:17 Changed 5 years ago by bdezonia

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

Note: See TracTickets for help on using tickets.