GeezerVison is showing github.com — Potential buffer leak in HttpObjectEncoder · Issue #6729 · netty/netty
Potential buffer leak in HttpObjectEncoder #6729
Description
4.1.10.Final. According to the commit history, HttpObjectEncoder did not change since December last year (4.1.7), so I'm not really sure it's a problem, but saw this:
LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
WARNING: 3 leak records were discarded because the leak record count is limited to 4. Use system property io.netty.leakDetection.maxRecords to increase the limit.
Recent access records: 5
#5:
io.netty.buffer.AdvancedLeakAwareByteBuf.setBytes(AdvancedLeakAwareByteBuf.java:354)
io.netty.buffer.ByteBufUtil.copy(ByteBufUtil.java:735)
io.netty.handler.codec.http.HttpHeadersEncoder.writeAscii(HttpHeadersEncoder.java:48)
io.netty.handler.codec.http.HttpHeadersEncoder.encoderHeader(HttpHeadersEncoder.java:35)
io.netty.handler.codec.http.HttpObjectEncoder.encodeHeaders(HttpObjectEncoder.java:160)
io.netty.handler.codec.http.HttpObjectEncoder.encode(HttpObjectEncoder.java:79)
...
According to the access records, something happened before writing all headers into the buffer allocated by HttpObjectEncoder, and is lost probably due to an exception. I couldn't find what the exception which may have caused this, however. (The log file is very crowded.)
Activity
Scottmitch commented on May 18, 2017
@trustin - if you can reproduce please increase io.netty.leakDetection.maxRecords as suggested and report back with the leak trace ... we may not have the complete picture here.
trustin commented on May 18, 2017
It was in the header encoding loop, so increasing maxRecords might not help much here.
It seems like the leak is gone after fixing some other leak which triggered OOME. So, my guess is that somehow an exception (OOME?) was triggered while encoding the headers and that triggered the leak reported in this issue.
Let me close this issue and file a new one when I see this again. Thanks for taking your time, @Scottmitch !
Reacted by Scott Mitchell
Metadata
Metadata
Development
No branches or pull requestsIssue actions