OutOfMemoryError

Hi,

I get this eror during inference (prediction on 28*28 pixels image):

We launch few thread (8) and we do about 50 prediction per second / thread.


image

workspaces are enabled by default right ?
I do not create INDArray elsewhere.

Some ideas what’s wrong ?
Thx a lot.

Workspaces are used within training automatically. But when you use the model and return arrays outside of the framework’s control, there is nothing we can do for you automatically, so if you want to use workspaces here, you will need to do so manually.

Do I have to use Workspace here ? I don’t see where i use arrays outside of framework’s control here :confused:

@raver119 when arrays are used like this, outside of a workspace context, i.e. as autoclosables, will they be freed immediately?

Yes, they must be released immediately.

In that case I’m not quite sure why it runs into an out of memory scenario.

The only thing I can see from your code is that you might want to use muli instead of mul to have that operation happen in place.

@arnaud22 can you try snapshots please, and tell us if the problem is reproducible there as well?

@raver119 I’m on beta 6, you want i try with beta 7 ?

Nope, 1.0.0-SNAPSHOT -> https://deeplearning4j.konduit.ai/config/config-snapshots

I will try with muli

Apologize, the problem was corrected by increasing the memory allocated to the JVM …