qtvbwfn commented on issue #1101: URL: https://github.com/apache/plc4x/issues/1101#issuecomment-1848312047
> ### 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. > >  > > 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 >  > >  > >  > >  > > ## 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 hi: It took me about three days, and I have fixed the thread and memory overflow issues in the V0.11.0 version. Can you create a new branch 0.11.1-SNAPSHOT for me to submit my code? The main issue is that the keepAlive in SecureChannel causes the channel to be occupied for a long time without being released. @chrisdutz @takraj @hutcheb  -- 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 For queries about this service, please contact Infrastructure at: us...@infra.apache.org