Dear all,
I had the same problem and found this thread. Digging further I stumbled over a different way to pin the process to cores 4 to 7:
Just add the line
CPUAffinity=4,5,6,7
to the
[Services]
section of your openhab2.service file. Systemd will then take care of pinning the process to the named cores.
After restarting openhab using
systemctl daemon-reload
systemctl restart openhab2
you can check CPU binding in the /proc
fileystem.
ps auxww | grep java
gives you all java processes on your system together with their pid (second column). In my case it is 6616
currently.
With
grep -i cpu /proc/6616/status
(replace 6616 by the PID you found for your java process) you should see the following output:
Cpus_allowed: f0
Cpus_allowed_list: 4-7
A process without CPU affinity would show
Cpus_allowed: ff
Cpus_allowed_list: 0-7
instead, so if you still see that output something went wrong.
The process runs stable for more than 12 hours now, while it crashed every couple of minutes before, so CPU-pinning really brings a great improvement.
Hope that helps
Wolfgang