# Netty4Utils fatal error on the network layer

**URL:** <https://discuss.elastic.co/t/netty4utils-fatal-error-on-the-network-layer/149574>\
**Category:** Elasticsearch\
**Created:** [September 23, 2018, 3:18am UTC](https://discuss.elastic.co/t/netty4utils-fatal-error-on-the-network-layer/149574 "2018-09-23T03:18:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eramitsinha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eramitsinha/32/35032_2.png) [@eramitsinha](https://discuss.elastic.co/u/eramitsinha)\
**Post date:** [September 23, 2018, 3:18am UTC](https://discuss.elastic.co/t/netty4utils-fatal-error-on-the-network-layer/149574/1 "2018-09-23T03:18:30Z")

</div>

Hi,

I am using Elastic Search 5.6.10 and Jdk 1.8.102, I was doing load testing this got failed and during Load testing(Only Search operation on Index) , below is logs.

I read:

> <https://github.com/elastic/elasticsearch/issues/24721>

Its mention to add:  
**-Dio.netty.recycler.maxCapacityPerThread=0**

This is on Elastic Search server jvm\_option Or **My Java Client code**

OR Both should have this.

* * *

java.lang.OutOfMemoryError: Java heap space  
Dumping heap to java\_pid39662.hprof ...  
Heap dump file created [7320078849 bytes in 15.922 secs]  
[ERROR] 2018-08-27 13:47:59.883 [elasticsearch[_client_][transport\_client\_boss][T#24]] Netty4Utils - fatal error on the network layer  
at org.elasticsearch.transport.netty4.Netty4Utils.maybeDie(Netty4Utils.java:184)  
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.exceptionCaught(Netty4MessageChannelHandler.java:84)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)  
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)  
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)  
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)  
at io.netty.handler.logging.LoggingHandler.exceptionCaught(LoggingHandler.java:175)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)  
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)  
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1301)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)  
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:914)  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:104)  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:145)  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:544)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)  
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)  
at java.lang.Thread.run(Thread.java:745)  
[ERROR] 2018-08-27 13:47:59.883 [elasticsearch[_client_][transport\_client\_boss][T#42]] Netty4Utils - fatal error on the network layer  
at org.elasticsearch.transport.netty4.Netty4Utils.maybeDie(Netty4Utils.java:184)  
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.exceptionCaught(Netty4MessageChannelHandler.java:84)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)  
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)  
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)  
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)

* * *

---

<div class="post-metadata">

**Author:** ![eramitsinha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eramitsinha/32/35032_2.png) [@eramitsinha](https://discuss.elastic.co/u/eramitsinha)\
**Post date:** [September 26, 2018, 12:52am UTC](https://discuss.elastic.co/t/netty4utils-fatal-error-on-the-network-layer/149574/2 "2018-09-26T00:52:58Z")

</div>

> [@eramitsinha](#):
>
> io.netty.recycler.maxCapacityPerThread

Following changes in Client JVM fixed this issue(Can you let me know Is this required at java Client end, if yes then it would be nice if you mention this in ES documents for TransportClient):

-Dio.netty.noUnsafe=true  
-Dio.netty.noKeySetOptimization=true  
-Dio.netty.recycler.maxCapacityPerThread=0  
-Dio.netty.allocator.type=unpooled

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 24, 2018, 12:53am UTC](https://discuss.elastic.co/t/netty4utils-fatal-error-on-the-network-layer/149574/3 "2018-10-24T00:53:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
