Python code is successful in config window but fails on node execution

Hii,
I am getting following error on executing my python script node…
Execute failed: An exception occured while running the Python kernel. See log for details

I have attached log file and screenshot of console window & python script

here is the log file…
log_file.txt (743.4 KB)

Hi @06mickey

In the log the following error is given:

Caused by: java.lang.OutOfMemoryError: Java heap space

My guess is your Knime session does not have enough memory to run the conversion from Python back into a Knime-table.
You can increase the memory of Knime through a change in the knime.ini file (it is located in the same directory where the knime.exe is located).

In this knime.ini is a line which starts with -Xmx like the following:

-Xmx8192m

In the above example the maximum memory Knime may use is 8192MB (or 8GB). I would not increase this number above 75% of the memory available on your machine, because you might run into other issues (crashing Knime completely or something like that).

Edit: you would have to restart Knime in order to make the change effective.

4 Likes

I already made it 10, still the issue persists

Do you have a large table? Or in other words: does this explain the memory issue?

I’m not 100% sure, but I can imagine the table will be in memory once “in Python format” and a second time “in Java-format” (as used by Knime). So if you have already a large table this might use a lot of memory.

Maybe you can reduce the table size, if you don’t need all columns within Python?

1 Like

From the code screenshot it looks like at a certain point the table might be there 3 times with small variations df2, df3, output_table. Have you tried deleting unused objects?

2 Likes

yes ,it worked, thanks ! :grinning:

2 Likes

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