Loading large files for headless cellprofiler

I am using CellProfiler 3.1.8 headless and I get an error loading my large files but not smaller files (or cropped versions of the large files):

Exception in thread “Thread-0” java.lang.OutOfMemoryError: Java heap space
at loci.formats.in.APNGReader.decode(APNGReader.java:381)
at loci.formats.in.APNGReader.openBytes(APNGReader.java:154)
at loci.formats.FormatReader.openBytes(FormatReader.java:886)
at loci.formats.FormatReader.openBytes(FormatReader.java:857)
Error detected during run of module NamesAndTypes

I tried adding “–jvm-heap-size=2g” to the cell profiler command, but I get “cellprofiler: error: no such option: --jvm-heap-size”

How do I adjust the java memory limit to allow for larger files?

Hi,

If you are working with large image files then you have to definitely increase the memory for Java virtual machine.

Click on the top menu bar CellProfiler > Preferences > Maximum memory for Java (MB)
Default value is set to be 512MB but you can increase this value to 6144 (MB).

By doing that hopefully you will process your large image files.

Good luck

Hamdah

Hi Hamdah,

Is there a way to increase the memory if I am running CellProfiler headless? I’m using the following command:

cellprofiler -p my_pipeline.cppipe -r -c -i input -o output

Thanks!