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

   ### What happened?
   
   The OPC-UA driver seem to leak memory when closing a connection object. This 
issue sooner or later lead to application crash with OOM error. Workaround 
would be to reuse connection objects, but then we face the issue #1100, which I 
believe renders a fix for this pretty urgent.
   
   ![Screenshot from 2023-09-23 
14-14-10](https://github.com/apache/plc4x/assets/2440418/17d5329b-e1ed-459c-bd1f-5d3339b22982)
   
   
   Example code to reproduce the issue:
   ```
   PlcDriverManager driverManager = new PlcDriverManager();
   
   AtomicBoolean running = new AtomicBoolean(true);
   Runtime.getRuntime().addShutdownHook(new Thread(() -> running.set(true)));
   
   while (running.get()) {
       PlcConnection connection = 
driverManager.getConnection("opcua:tcp://127.0.0.1:40185/milo?discovery=false");
       try {
           Thread.sleep(100);
       } finally {
           connection.close();
       }
   }
   ```
   
   Some additional charts
   --------------------------------
   
   ![Screenshot from 2023-09-23 
14-23-14](https://github.com/apache/plc4x/assets/2440418/1384d3d8-63b8-4abb-ac75-4843d9bf72b2)
   
   ![Screenshot from 2023-09-23 
14-08-05](https://github.com/apache/plc4x/assets/2440418/0a50afb6-3d8d-436f-afcb-a3bb7253f1f1)
   
   ![Screenshot from 2023-09-23 
14-10-16](https://github.com/apache/plc4x/assets/2440418/e98e765c-79a5-40bc-b342-4c4acd9c9337)
   
   ![Screenshot from 2023-09-23 
14-10-25](https://github.com/apache/plc4x/assets/2440418/913b2138-0571-4cff-a75b-9ebedebb1f56)
   
   Logs
   --------
   
   
[logs-before-oom.txt](https://github.com/apache/plc4x/files/12706498/logs-before-oom.txt)
   
   Heap dumps
   -------------------
   
   * 
[MemoryLeakDemo_1045304_23_09_2023_12_41_27.zip](https://github.com/apache/plc4x/files/12706514/MemoryLeakDemo_1045304_23_09_2023_12_41_27.zip)
   * 
[MemoryLeakDemo_1045304_23_09_2023_13_02_21.zip](https://github.com/apache/plc4x/files/12706515/MemoryLeakDemo_1045304_23_09_2023_13_02_21.zip)
   * 
[MemoryLeakDemo_1045304_23_09_2023_14_05_15.zip](https://github.com/apache/plc4x/files/12706519/MemoryLeakDemo_1045304_23_09_2023_14_05_15.zip)
   
   
   ### Version
   
   v0.10.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [X] OPC-UA
   - [ ] S7


-- 
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: dev-unsubscr...@plc4x.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to