Weka memory problem

Trainable Weka segmentation on ‘train classifier’ is throwing up the exception

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: unable to create new native thread

How to solve without restarting my machine?

Hello @robmarkcole,

I’m sorry for the delay on answering you, I just saw your message. In general, this type of exceptions are caused by either the limitation of maximum memory you’re using (editable under Edit > Options > Memory & Threads), the size of your input image(s) or the number of features you selected.

For the training to throw an out-of-memory exception it must be that the image you’re training on and its corresponding features are too large for the maximum memory you have.

What is the size and type (8-bit, RGB, etc) of your image? How much RAM do you have?


HI Ignacio, thanks for the info. I have 1.5 Gb memory available. Image was 8-bit grey scale of size 1024 x 768 pixels.

Yeah, that’s in the limit of your 1.5GB of RAM. I made the test using a grayscale 8-bit image of that size and the default features (which add up to 76 different features). My system says ImageJ is using 1.4GB.

You might want to use a smaller image or less features (have a look at the Settings), or run the segmentation on a machine with more memory.


1 Like

Excellent thanks for the information.