OMERO: large CZI import fails w/ Java heap space out of memory

Hi OME team,

I’m trying to import a very large CZI image (89GB, consisting of 152 scenes with 5-channel images per scene, stored as uncompressed) using the CLI importer into a current OMERO 5.6.2 on Ubuntu 18.04 (Java 11). The import fails with:

sudard@graylab:/data/share/dataxchange/QiTissue/BM-Her2N75-15$ omero import -d 4051 R2_PCNA.Her2.ER.CD45_BM-Her2N75-15_2017_08_11__2327.czi --debug WARN
Previous session expired for username on
Server: []
Username: [username]
Created session for Idle timeout: 10 min. Current group: GrayLab
2020-09-12 15:02:35,522 505        [      main] INFO          ome.formats.importer.ImportConfig - OMERO.blitz Version: 5.5.7
2020-09-12 15:02:35,552 535        [      main] INFO          ome.formats.importer.ImportConfig - Bioformats version: 6.5.1 revision: 6f50e4d52c9d96112635fd8b2dde737f31041cf0 date: 7 July 2020
2020-09-12 15:02:40,057 5040       [      main] ERROR     ome.formats.importer.cli.ErrorHandler - FILE_EXCEPTION: /home/groups/graylab_share/OMERO.rdsStore/dataxchange/QiTissue/BM-Her2N75-15/R2_PCNA.Her2.ER.CD45_BM-Her2N75-15_2017_08_11__2327.czi
java.lang.Exception: java.lang.OutOfMemoryError: Java heap space
        at ome.formats.importer.ImportCandidates.singleFile( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.ImportCandidates.handleFile( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.ImportCandidates.execute( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.ImportCandidates.<init>( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.ImportCandidates.<init>( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.cli.CommandLineImporter.<init>( ~[omero-blitz.jar:5.5.7]
        at ome.formats.importer.cli.CommandLineImporter.main( ~[omero-blitz.jar:5.5.7]
Caused by: java.lang.OutOfMemoryError: Java heap space
        at$Attachment.fillInData( ~[formats-gpl.jar:6.5.1]
        at ~[formats-gpl.jar:6.5.1]
        at ~[formats-gpl.jar:6.5.1]
        at loci.formats.FormatReader.setId( ~[formats-api.jar:6.5.1]
        at loci.formats.ImageReader.setId( ~[formats-api.jar:6.5.1]
        at ome.formats.importer.OMEROWrapper$4.setId( ~[omero-blitz.jar:5.5.7]
        at loci.formats.ReaderWrapper.setId( ~[formats-api.jar:6.5.1]
        at loci.formats.ChannelFiller.setId( ~[formats-bsd.jar:6.5.1]
        at loci.formats.ReaderWrapper.setId( ~[formats-api.jar:6.5.1]
        at loci.formats.ChannelSeparator.setId( ~[formats-bsd.jar:6.5.1]
        at loci.formats.ReaderWrapper.setId( ~[formats-api.jar:6.5.1]
        at loci.formats.Memoizer.setId( ~[formats-bsd.jar:6.5.1]
        at loci.formats.ReaderWrapper.setId( ~[formats-api.jar:6.5.1]
        at ome.formats.importer.ImportCandidates.singleFile( ~[omero-blitz.jar:5.5.7]
        ... 6 common frames omitted
2020-09-12 15:02:43,256 8239       [      main] WARN                    ome.system.UpgradeCheck - UPGRADE AVAILABLE:Please upgrade to 5.6.1. See for the latest version.
No imports due to errors!

There are no indications in the OMERO logs what exactly is causing the OOM and the fail happens very quickly so it appears to be the “front-end” importer itself that fails. Can I do something at the command line to give the Java import process more memory or to get a bit more logging to know what to do? The image itself loads fine into ZEN so appears to be not corrupted. It’s way too big to upload to the QA site. Any suggestions?


Hi Damir,

You can increase the Java memory used client-side by the importer using JAVA_OPTS e.g.

$ export JAVA_OPTS=-Xmx4G
$ omero import -d 4051 R2_PCNA.Her2.ER.CD45_BM-Her2N75-15_2017_08_11__2327.czi --debug WARN

As long as the server is configured with at least as much memory which is usually the case, I expect this should fix the problem.


Thanks Sebastien, that indeed works fine. Just a quick follow-up:

  1. what is the default amount of memory the client-side gets if you don’t set the JAVA_OPTS?
  2. since I frequently have such large images, I’ll want to change that default to something higher for all users. Where can I do so?


Hi Damir,

the default memory settings for the client-side importer is defined in as 1G currently.

Apart from setting JAVA_OPTS in your import environment or hardcoding a larger value in the library, I imagine a more flexible option might be to make this value configurable via an option passed to the command. Let us know what works best for you and/or feel free to open a contribution against omero-py.