Java heap space error


#1

Hey,

I have an error message while I update NamesandTypes:
Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 2094, in prepare_run
File “cellprofiler\modules\metadata.pyc”, line 732, in prepare_run
File “cellprofiler\utilities\jutil.pyc”, line 785, in call
File “cellprofiler\utilities\jutil.pyc”, line 762, in fn
JavaException: Java heap space

  • see attachments,

I used the pipeline and a set of images previously. java, cell profiler… have been updated recently,

thank you!




#2

If you encounter JVM/Java memory errors, sometimes this is a result of large number of images that are being processed, or a large amount of metadata that is being used. Is this true in your case? Would you mind posting your project files that’s causing the problem?

To handle this, you can tell CellProfiler to increase the size of the Java heap memory on startup. To do this, you’ll need to run CellProfiler from the command line:

  • Open a command prompt. If you don’t know how to do this, here’s a tutorial: pcsupport.about.com/od/windows-8 … dows-8.htm

  • Switch to the folder that you installed CellProfiler. If you used the defaults, it’s in C:\Program Files\CellProfiler, so type (note the dbl quotes): cd "C:\Program Files\CellProfiler"

  • Run CellProfiler with the following argument: CellProfiler.exe --jvm-heap-size=JVM_HEAP_SIZE where JVM_HEAP_SIZE is the amount of memory to be reserved for the JVM. Example formats for JVM_HEAP_SIZE include 512000k, 512m, 1g, etc. For example, to increase the JVM heap memory to 2GB, use --jvm-heap-size=2g

Regards,
-Mark


#3

thanks! that helped for a while but now I encounter another java problem:
Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 2094, in prepare_run
File “cellprofiler\modules\metadata.pyc”, line 732, in prepare_run
File “cellprofiler\utilities\jutil.pyc”, line 785, in call
File “cellprofiler\utilities\jutil.pyc”, line 762, in fn
JavaException: GC overhead limit exceeded
thank you in advance.


#4

Do you get this upon loading your images and/or during metadata extraction? You likely have a large image set?
If so, this looks to be the same issue: viewtopic.php?f=16&t=4061

The basic suggestion there is to use LoadData instead of the Input modules.

Side note: There is now a setting in Preferences (CellProfiler Menu -> Preferences -> Maximum memory for Java) to set the Java JVM heap size, rather than needing to use command-line.

Cheers,
David


#5

You can increase to 4GB on a 32 bit system. If you’re on a 64 bit system you can go higher. No need to worry if you’ve chosen incorrectly, if you ask for 5g on a 32 bit system java will complain about an invalid value and quit.

Ling