New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JS scripting engine] Memory Leak #11952
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/javascript-memory-stability-issues/130810/13 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
Just leaving a note here: From a small investigation I could not see anything in openHAB code which appears to leak upon repeated script load failure. One possible source of leaking could be from inside Graal itself, because the engines (and hence the polyglot contexts) are not being closed ( |
I have verified that the leak is due to my guess. Well, I repeatedly reloading an erroring script and did managed to push up the memory (by about 25%, although I couldn't get it any higher), however my closing engines I could not increase it at all. This requires changes in both core and the add-on. The core change is openhab/openhab-core#2681 |
The other change required is: #12022 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
As per digitaldan's request I re-open this ticket here which seems to be related to JSscripting.
When changing and testing JS scripts (edition 11) which have syntax errors, after 10-20 runs the CPU load increases to 100% and you get the following error messages:
2021-12-29 22:12:59.868 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /rest/rules/SystemReadLog java.lang.OutOfMemoryError: Java heap space
2021-12-29 22:14:35.128 [WARN ] [ab.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.openhab.core.io.monitor.internal.EventLogger@16f740b' takes more than 5000ms.
2021-12-29 22:19:26.790 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: java.lang.OutOfMemoryError: Java heap space
Let me be more precise: at least the memory leak can be reproduced with faulty JS scripts - I am not saying that the script engine is the root cause of the poblem. I just wanted to bring this to your attention.
This problem has been confirmed by a couple of users yet.
See here
and here
Environment
latest openhab 3.2 and Zulu11-32 version installed by latest openhabian update option
Raspberry Pi4
The text was updated successfully, but these errors were encountered: