Execute failed: Java heap space

Good day @Karlygash !

On top of increasing the heap space using the entry “-Xmx” in the knime.ini file, the following actions may be taken too to improve the use of the Java heap space during execution:

  1. Set the Memory Policy of the nodes that are memory consuming to “Write Tables to Disc”:

image

  1. Use -Run Garbage Collector- or -Run Heavy Garbage Collector- node by @Vernalis before and/or after running the nodes that are memory consuming:

For instance, in the above example, I’m flushing within a loop the heap space at the end of every iteration within a loop, which forces to clean up the heap space before executing the next loop iteration.

I guess in your case you are reading the different sheets within a loop. You could then flush the memory after reading each Excel sheet and before reading next by setting the Garbage Collector node as shown in the snapshot above.

  1. KNIME is capable of running nodes in parallel, which means that they are clogging the heap space at the same time too. If you have several nodes running at the same time in your workflow, I would recommend to force them to run sequentially by connecting them with the red variable connections, for instances as follows to write several Excel files:

image

As shown in the snapshot above, the red variable connections force the nodes to write the excel sheets sequentially. Without these connections, they would have been run in parallel.

  1. Complementary information to these hints is available here too:
  1. Finally you can monitor “in real time” the use of your computer resources with the Windows task monitor (as far as I remember you use Windows), if you keep it open on a corner of your monitor while executing your workflow. It should give precious information about how the workflow is using the memory in real time as it goes.

Hope these hints help :wink:

Good luck @Karlygash !

Best wishes,

Ael

8 Likes