daniells92 commented on issue #2248:
URL: https://github.com/apache/plc4x/issues/2248#issuecomment-3291612045
Hello,
we have the same issue.
plc4j version 0.12.0 connected to a S7_300.
The application runs 24/7.
It reads every second from the PLC and writes event based every few seconds.
Sometimes it takes 1-2 weeks until an OutOfMemmoryError, sometimes it's over
one month.
Seems like it directly allocates memory and never releases it.
2025-07-21 08:49:33,460 INFO | plc4x-tm-thread-2 |
o.a.p.java.spi.transaction.RequestTransactionManager |
java.lang.OutOfMemoryError: Cannot reserve 4194304 bytes of direct buffer
memory (allocated: 2118267416, limit: 2122317824)
2025-07-21 08:49:42,987 WARN | scheduling-1 |
de.myApp.plcbridge.s7.S7Reader | Could not execute read request!
java.util.concurrent.ExecutionException:
org.apache.plc4x.java.api.exceptions.PlcProtocolException: Error reading
at
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at de.myApp.plcbridge.s7.S7Reader.readFromPlc(S7Reader.java:66)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
at
org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
at io.micrometer.observation.Observation.observe(Observation.java:498)
at
org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
at
org.springframework.scheduling.config.Task$OutcomeTrackingRunnable.run(Task.java:85)
at
org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.apache.plc4x.java.api.exceptions.PlcProtocolException: Error
reading
at
org.apache.plc4x.java.s7.readwrite.protocol.S7ProtocolLogic.lambda$18(S7ProtocolLogic.java:314)
at
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at
java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2194)
at
org.apache.plc4x.java.s7.readwrite.protocol.S7ProtocolLogic$TransactionErrorCallback.accept(S7ProtocolLogic.java:2202)
at
org.apache.plc4x.java.s7.readwrite.protocol.S7ProtocolLogic$TransactionErrorCallback.accept(S7ProtocolLogic.java:1)
at
org.apache.plc4x.java.spi.Plc4xNettyWrapper.lambda$8(Plc4xNettyWrapper.java:253)
at
org.apache.plc4x.java.spi.netty.NettyHashTimerTimeoutManager.lambda$0(NettyHashTimerTimeoutManager.java:55)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:713)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:701)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:787)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:501)
... 1 common frames omitted
Caused by: java.util.concurrent.TimeoutException: null
at
org.apache.plc4x.java.spi.netty.NettyHashTimerTimeoutManager.lambda$0(NettyHashTimerTimeoutManager.java:54)
... 6 common frames omitted`
--
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]