Given that and your error message/stack trace, your problem is not the one described in this thread. If you had the problem described in this thread, it would never work.
I’m reporting back on my problem. I went back to 3.4.0 Stable, yet the problem remained – increasing CPU usage until the system bogged down, leading to a spontaneous OH restart and the process repeating itself (it took about 2-3 days until it became unusable).
About the same time that I updated my OH version (which seemed to precipitate the problem), I had also added the iRobot binding. So I decided to remove this binding to see if that was the culprit. After removing the binding, everything returned to normal. CPU usage is right where it used to be and it’s stable.
So right now I’m assuming it was something about the iRobot binding. It’s beyond me to diagnose exactly what, so I’ll do without this binding for now. If this information should be added to a different thread I can certainly do that.
I am not using the iRobot binding, so I cannot help, but I would recommend to search the forum for iRobot problems and open a new thread if no one else did it before.
Would you mind reuploading it? I got the Failed to execute action: 2(Could not initialize class org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine) with OH 4.0.2 now, starting with bundle org.openhab.core.automation.module.script:4.0.2 (162)[org.openhab.core.automation.module.script.ScriptTransformationServiceFactory(102)] : The setScriptEngineFactory method has thrown an exception when it’s loaded.