Hi,
Sorry for being late to the party. I just stumbled across this very forum post when reading up on this recent forum post that discusses heap space exhaustion in KNIME Analytics Platform 4.0.1.
@Dirk, to reproduce the memory leak you observed, I build a workflow similar to yours. It re-runs the Java Snippet node 100,000 times:
I then forced a full sweep garbage collection, detected current heap space consumption to be at ~119 MB, ran the workflow (in KNIME Analytics Platform 4.0.1), reset the workflow, forced another full sweep garbage collection, and detected current heap space consumption to be at ~120 MB. In other words, I wasn’t able to reproduce a memory leak in the Java Snippet node.
KNIME Analytics Platform 4.0 fixed some UI-related memory leak and also fixed some performance issue with Java Snippet nodes in loops. Maybe the issue has been fixed for you as well?
Another reason for increased memory allocation after execution (and reset) of some nodes could be the Console View. When I ran aforementioned workflow after setting the Console View Log Level to DEBUG or INFO in File -> Preferences -> KNIME -> KNIME GUI, about 70 MB of additional heap space was used up by info messages shown on the Console View.
If the issue persists for you in KNIME 4.0.1 and you could provide me with a minimal workflow with which I can reproduce the issue, I am happy to look into it further.
Best,
Marc