Problem of Using R within KNIME

Hi,

I’m running R model through the R snippet node within KNIME. I have set Path to R HOME to the original R in my computer(3.5.1version), also adjusted Rserve receiving limit to 0. However, I received memory error ‘Cannot allocate vector of size 5.4 Gb’ each time. The model can work in Rstudio. The ram of my computer is 12G, and there are 100,000 objects of 7 variables in my data.

Did anyone have the same problem? Did someone find the solution?
I would appreciate any feedback.

Thanks,
Jou

there are several R snipet packages within KNIME, I Suggest you to use “KNIME Interactive R Statistics Integration” as is called in KNIME 3.6 that opens automatically rserve session when needed. It works perfectly even with big datasets. Another check could be to see if you use the same version in knime and Rstudio.

2 Likes

Hi @cosimotoma,

Thank you for your help. I have tried the approach you mentioned above. The result still came out the same. Could you please give me some suggestions? I have tried many approaches to fixed the problem, but all in vain.

Again,
thank you very much!

Jou

Error messages beginning cannot allocate vector of size indicate a failure to obtain memory, either because the size exceeded the address-space limit for a process or, more likely, because the system was unable to provide the memory.

R wants 5.4GB of RAM but your computer doesn’t have that much free memory so it fails. 12GB isn’t that much. The OS will already use several GB of that, KNIME as well depending on your ini settings (-Xmx). So if your OS uses 4 GB, KNIME uses 4 GB you only have 4 GB left but you need 5.4GB.

Does it work in Rstudio when you have the same knime workflow open and executed?

Also 54.GB sounds liek a lot for just 100k rows and 7 variables. I would also check your R-code!

2 Likes

Thanks for reply. I have fixed the problem. The reason why the code worked in Rstudio but failed in KNIME is because the variable type is different in Rstudio and KNIME table. I transformed the variable type and it works now!

Thank you very much!!

Jou

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.