R temporary files

Thanks for the helpful QA session. This question was not fully addressed in the QA session and wanted to discuss it here further.

Original question:

Hi all! Is there a plan to discard temporary files created by the R nodes to contain workspaces? These files keep the workspace in the output port (RPortObject) and are not deleted until KNIME is closed. I am worried with big R models running on a server that is not restarted for days. Thanks!

I think the answer from Tobias was that the temporary workspace file was to be deleted when resetting the node and if not it is a bug. So I went to the RSnippetNodeModel at https://github.com/knime/knime-r/blob/50cb073a37cdc909d2e0d68d76a8ae0060ab90dd/org.knime.r/src/org/knime/r/RSnippetNodeModel.java from the package org.knime.r. There, in executeSnippet on line 205 tempWorkspaceFile is created using FileUtil.createTempFile(String, String). According to the java doc of createTempFile:

Creates a temp file that is deleted when the JVM is shut down. See

From what I see the reset method is not removing this file:

protected void reset() {

    m_librariesInR = null;

Now if I found a bug I am happy to report it, but I am concerned because I have real models with some workspaces bigger than 500MB and my server admin might not be really happy with me. In my extension nodes I am having the same problem and I am considering an age filter that removes files after a while. I am highly interested in how you approach this.

Thanks again,


thx we’ll have a look at the reset. Once I’ve done that I’ll get back to you respective the other question.




I had a look into the issue and we create a ticket for this. I cannot promise anything, but I’m confident that we’ll ship the fix with 4.2.

Once this issue is fixed this two nodes might help with your second problem https://hub.knime.com/knime/spaces/Examples/latest/99_Community/01_Image_Processing/01_Tutorials/01_Node_Tutorials/17_Dont_Save.
There’s also another way how to do it, but this is very unlikely to be released with 4.2.

Thx for finding this bug and I’m very sorry that I cannot help you with your second problem any further (for now).