-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io.netty.util.internal.OutOfDirectMemoryError #378
Comments
@yu199195 run the application with this setting Also did you set manually the Netty version because Reactor Netty 0.7.7 comes with Netty 4.1.24 as a dependency https://github.com/reactor/reactor-netty/releases/tag/v0.7.7.RELEASE |
i canot find reason。 and alsoi add -Dio.netty.leakDetectionLevel=advanced but not find any log。 |
in my code ,No out-of-heap memory is used . why Out of heap memory overflow? dont understand. |
Without knowing the scenario it is hard to say whether it is an issue or misconfiguration. Try to increase this |
let me try ,tks |
@violetagg hi,i find netty use DIRECT_MEMORY_COUNTER To count the memory out of the heap |
If you have a simple reproduction test that would be awesome! |
i use spring-webflux ,In my code, no out-of-heap memory is used,reactor-netty will release buffers? |
@yu199195 were you able to prepare some reproducible scenario? |
Closing this as there is no response from the author. @yu199195 you can reopen it if you have more details about the issue. |
There might be an error (reported elsewhere). I can think of having elastic scheduler at play (or many threads will have an arena cache created). The other thing is webflux/spring webclient might have a niche leak of some sort. It's worth keeping track of it |
Could be related to https://jira.spring.io/browse/SPR-16633 |
@smaldini tks |
Just got it myself.
Nothing particularly unique, just Spring Cloud Gateway + some WebClient calls. |
Spring Webclient just fixed a small leak. https://jira.spring.io/plugins/servlet/mobile#issue/SPR-17025 |
All, try the latest |
Things still leak with the gateway if retry is on and this build. |
@dave-fl Let's track it in the spring gateway issue, if it appear reactor netty we will reopen/create new issue. |
@violetagg
2019-07-20 00:10:15.417 ERROR 1 --- [ scheduling-4] c.b.scannerj.quartz.EthQuartzService : scheduled error 2.then,after a while io.netty.channel.unix.Errors$NativeIoException: syscall:read(..) failed: Connection reset by peer 3.At last,as above ' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception: |
@kevinwan1986 this issue is already closed, please create a new one |
netty4默认使用堆外内存,要手动释放。byteBuf.release(); |
@kevinwan1986 Did you manage to find a fix? I'm also getting this on high load: 2021-04-22 08:31:13.071 WARN 1 --- [tor-tcp-epoll-1] i.n.c.AbstractChannelHandlerContext : An exception 'reactor.core.Exceptions$BubblingException: reactor.netty.ReactorNetty$InternalNettyException: java.lang.OutOfMemoryError: Java heap space' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception: reactor.core.Exceptions$BubblingException: reactor.netty.ReactorNetty$InternalNettyException: java.lang.OutOfMemoryError: Java heap space |
hi, a web service is built with webflux. With time and increased concurrency,
I found that netty's off-heap memory was not freed.(About 3 hours after the service runs)
its, reactor-netty problem?
this is my evn:
spring boot 2.0.3
jdk 1.8
os: liunx
reactor-netty:0.7.7
netty:4.1.17
this is eror:
2018-06-27 09:32:58.217 WARN 6811 --- [server-epoll-11] i.n.c.AbstractChannelHandlerContext : An exception '{}' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 520093703, max: 524288000)
at io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:640) ~[netty-common-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:594) ~[netty-common-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PoolArena$DirectArena.allocateDirect(PoolArena.java:764) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PoolArena$DirectArena.newChunk(PoolArena.java:740) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PoolArena.allocateNormal(PoolArena.java:244) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PoolArena.allocate(PoolArena.java:214) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PoolArena.allocate(PoolArena.java:146) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:324) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:185) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:176) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:137) ~[netty-buffer-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:114) ~[netty-transport-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.channel.epoll.EpollRecvByteAllocatorHandle.allocate(EpollRecvByteAllocatorHandle.java:71) ~[netty-transport-native-epoll-4.1.25.Final-linux-x86_64.jar!/:4.1.25.Final]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:793) ~[netty-transport-native-epoll-4.1.25.Final-linux-x86_64.jar!/:4.1.25.Final]
at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:387) [netty-transport-native-epoll-4.1.25.Final-linux-x86_64.jar!/:4.1.25.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-common-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [netty-common-4.1.25.Final.jar!/:4.1.25.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:313) [netty-transport-native-epoll-4.1.25.Final-linux-x86_64.jar!/:4.1.25.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-common-4.1.25.Final.jar!/:4.1.25.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
2018-06-27 09:32:58.217 WARN 6811 --- [server-epoll-16] i.n.c.AbstractChannelHandlerContext : An exception '{}' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
The text was updated successfully, but these errors were encountered: