leomy opened a new issue, #2330:
URL: https://github.com/apache/plc4x/issues/2330

   ### What happened?
   
   I found that the way Netty is being used is incorrect. Currently, a "one 
connection per thread" model is adopted, and it has been observed that many 
issues are caused by resource leaks due to abnormal connection closure. 
Therefore, it is recommended to use the genuine Reactor network programming 
model in Netty to reduce resource usage and avoid memory leaks.
   
   The code is as follows:
   1. 
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory#createBootstrap
  
[NettyChannelFactory.java](https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory.java).
 pls share the NioEventLoopGroup with all connections
   2. 
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/transaction/RequestTransactionManager#executor
 
[RequestTransactionManager.java](https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/transaction/RequestTransactionManager.java).
 pls  share executor with all connections
   3、plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper 
[Plc4xNettyWrapper.java] 
(https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java)
   
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/netty/NettyHashTimerTimeoutManager
 
[NettyHashTimerTimeoutManager](https://github.com/apache/plc4x/blob/develop/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/netty/NettyHashTimerTimeoutManager.java).
 
   pls share netty timer with all connections
   
   
   
   ### Version
   
   v0.13.1
   
   ### Programming Languages
   
   - [ ] plc4c
   - [ ] plc4go
   - [x] plc4j
   - [ ] plc4net
   - [ ] plc4py
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] C-Bus
   - [ ] CANopen
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] IEC-69870
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [ ] OPC-UA
   - [ ] Profinet
   - [x] S7
   - [x] S7-light


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to