Hello,
Recently I added satel binding for handling INT-RS module. I can observe that with time number of java threads constantly grows (from 56 up to over 300) affecting the system performance. The increasing number of thread is most probably caused by accidental serial port disconections (from time to time serial port is closed)
Probably the bug is in IntRSModule.java,
In connection routine a serialPortListener is created and thread is put to sleep:
serialPort.addEventListener(new SerialPortEventListener() {
_ @Override_
_ public void serialEvent(SerialPortEvent ev) {_
_ try {_
_ logger.trace(“RXTX library CPU load workaround, sleep forever”);_
_ Thread.sleep(Long.MAX_VALUE);_
_ } catch (InterruptedException e) {_
_ }_
_ }_
but on port disconnect only port is closed (this.serialPort.close()
I’m not java expert but shouldn’t you remove listener?: this.serialPort.removeEventListener(); or release thread on different way?
I cannot build a snapshot of satel package so I’m not able to check whether removing event listener solves the problem
Could you please verify this bug?
thx
Peter