Skip to content

Commit faf6e98

Browse files
committed
Disable the Netty recycler
Netty plays a lot of games with recycling byte buffers in thread local caches. The recycler in particular appears to be fraught with peril. It appears that there are circumstances where the recycler does not recycle quickly enough and can exceed its capacity leading to heap exhaustion and out of memory errors. If you spend a few minutes reading the history of the recycler on the Netty GitHub issues, it appears it has been nothing but a source of trouble, and the project itself has an open issue that proposes disabling by default and possibly even removing the recycler. We are seeing users struggle with issues in 5.x that I think are largely driven by some of the problems here with Netty. This change proposes to disable the recycler I think that disabling this feature will return some of the stablity that these features appear to be losing us. Relates #22452
1 parent 66f3129 commit faf6e98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

distribution/src/main/resources/config/jvm.options

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@
6565
# use old-style file permissions on JDK9
6666
-Djdk.io.permissionsUseCanonicalPath=true
6767

68-
# flags to keep Netty from being unsafe
68+
# flags to configure Netty
6969
-Dio.netty.noUnsafe=true
7070
-Dio.netty.noKeySetOptimization=true
71+
-Dio.netty.recycler.maxCapacityPerThread=0
7172

7273
# log4j 2
7374
-Dlog4j.shutdownHookEnabled=false

0 commit comments

Comments
 (0)