Serial port binding cpu usage

I’ve noticed that openhab is constantly using about 15% percent of the cpu on my BeagleBone Black. I’ve found out that a thread of the serial port binding is causing this cpu load. 15% is not much, but I’m planning on adding more than one serial port binding to my openhab installation and that would mean 30% cpu usage for two ports, 45 for 3 ports etc. Here is the thread that is using the cpu:

“Thread-30” daemon prio=10 tid=0xa69c2ba8 nid=0x3abb runnable [0xa5f77000]
java.lang.Thread.State: RUNNABLE
at Method)

I also found several oder thread regarding this problem:!topic/openhab/LT6OfgRTfdU!topic/openhab/Ms4K1NCphbc

In those threads the solution was to register the serial port event and to sleep indefinitely in the event. But the serial port binding uses the serial port event to receive the data. How could the cpu usage be reduced when using the event? Maybe do Thread.sleep after every event?

I’ve now configured a second serial port binding and the cpu load has doubled to 30% and I will have to add even more serial ports. How can I solve this problem?

I think we found a solution for the problem: