-
Notifications
You must be signed in to change notification settings - Fork 353
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
Netty resource leak #3568
Comments
@cclient Commented develop base on https://github.com/jersey/jersey/tree/master/examples/helloworld-netty 2017-05-26 14:23:08 ERROR ResourceLeakDetector:285 - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information. |
|
Same problem here |
same problem too |
please refer to Jersey version |
version:2.27
in my case the var of 'take' is ByteBufInputStream which contain ByteBuf buffer; so i add fellow code: finally {
the leak seems solved |
This commit contains a rewritten implementation of Netty Jersey server and client with the following major changes: 1) Consume `ByteBuf`s from `HttpContent` as-is for processing. 2) Fixes major leak and timout issues reported in eclipse-ee4j#3500 , eclipse-ee4j#3568 and eclipse-ee4j#4286 3) Fixes a bug on reading 0-byte or 1-byte JSON content Signed-off-by: Venkat Ganesh 010gvr@gmail.com
This commit contains a rewritten implementation of Netty Jersey server and client with the following major changes: 1) Consume `ByteBuf`s from `HttpContent` as-is for processing, reduces a lot of overhead. 2) Fixes a bug on reading 0-byte or 1-byte JSON content 3) Add three new configurable `ChunkedInput` buffer properties through `jersey.ci.capacity`, `jersey.ci.read.timeout` and `jersey.ci.write.timeout` 4) Add configurable payload size through `jersey.max.http.request.entitySizeMb` , defaults to 50 Mb This change should fix some of the long pending bug reports in eclipse-ee4j#3500 , eclipse-ee4j#3568 and eclipse-ee4j#4286 . This may also resolve eclipse-ee4j#4285 Signed-off-by: Venkat Ganesh 010gvr@gmail.com
This commit contains a rewritten implementation of Netty Jersey server and client with the following major changes: 1) Consume `ByteBuf`s from `HttpContent` as-is for processing, reduces a lot of overhead. 2) Fixes a bug on reading 0-byte or 1-byte JSON content 3) Add three new configurable `ChunkedInput` buffer properties through `jersey.ci.capacity`, `jersey.ci.read.timeout` and `jersey.ci.write.timeout` 4) Add configurable payload size through `jersey.max.http.request.entitySizeMb` , defaults to 50 Mb This change should fix some of the long pending bug reports in eclipse-ee4j#3500 , eclipse-ee4j#3568 and eclipse-ee4j#4286 . This may also resolve eclipse-ee4j#4285 Signed-off-by: Venkat Ganesh 010gvr@gmail.com
This commit contains a rewritten implementation of Netty Jersey server and client with the following major changes: 1) Consume `ByteBuf`s from `HttpContent` as-is for processing, reduces a lot of overhead. 2) Fixes a bug on reading 0-byte or 1-byte JSON content 3) Add three new configurable `ChunkedInput` buffer properties through `jersey.ci.capacity`, `jersey.ci.read.timeout` and `jersey.ci.write.timeout` 4) Add configurable payload size through `jersey.max.http.request.entitySizeMb` , defaults to 50 Mb This change should fix some of the long pending bug reports in eclipse-ee4j#3500 , eclipse-ee4j#3568 and eclipse-ee4j#4286 . This may also resolve eclipse-ee4j#4285 Signed-off-by: Venkat Ganesh 010gvr@gmail.com
This commit contains a rewritten implementation of Netty Jersey server and client with the following major changes: 1) Consume `ByteBuf`s from `HttpContent` as-is for processing, reduces a lot of overhead. 2) Fixes a bug on reading 0-byte or 1-byte JSON content 3) Add three new configurable `ChunkedInput` buffer properties through `jersey.ci.capacity`, `jersey.ci.read.timeout` and `jersey.ci.write.timeout` 4) Add configurable payload size through `jersey.max.http.request.entitySizeMb` , defaults to 50 Mb This change should fix some of the long pending bug reports in eclipse-ee4j#3500 , eclipse-ee4j#3568 and eclipse-ee4j#4286 . This may also resolve eclipse-ee4j#4285 Signed-off-by: Venkat Ganesh 010gvr@gmail.com
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
Current unit tests only validate Netty's `JerseyClientHandler` against a Grizzly http server. This commit adds test cases to validate the same using Netty's `JerseyServerHandler` using `NettyTestContainerFactory`. Also adding extra test cases to effectively validate the bug fixes for eclipse-ee4j#3500 and eclipse-ee4j#3568 (that is, these new test cases will fail if ran against the code base older than eclipse-ee4j#4312) Fixes eclipse-ee4j#3500 and eclipse-ee4j#3568 Signed-off-by: Venkat Ganesh <010gvr@gmail.com>
When I run Jersey using the Netty http2 container and a custom MessageBodyReader/Writer I get Netty resource leaks. (I did not test to see if the resource leaks happen even in the absence of the custom reader/writer; my app requires them.)
I register the custom handler with a ResourceConfig and create the server like this:
Channel channel = NettyHttpContainerProvider.createHttp2Server(
URI.create("http://" + host + ":" + port + "/"), conf, null);
Within the handler all I'm doing is reading from the InputStream entityStream.
In the test app I set:
ResourceLeakDetector.setLevel(Level.ADVANCED);
io.netty.util.ResourceLeakDetector 11732 ERROR LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
WARNING: 17 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.readBytes(AdvancedLeakAwareByteBuf.java:501)
io.netty.buffer.ByteBufInputStream.read(ByteBufInputStream.java:120)
org.glassfish.jersey.netty.connector.internal.NettyInputStream.read(NettyInputStream.java:110)
org.glassfish.jersey.message.internal.EntityInputStream.read(EntityInputStream.java:102)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream.read(ReaderInterceptorExecutor.java:296)
com.dieselpoint.buffers.ByteUtil.readBuffer(ByteUtil.java:175)
com.dieselpoint.cluster.common.Command.readFrom(Command.java:65)
com.dieselpoint.raft.RaftSerializer.readFrom(RaftSerializer.java:68)
com.dieselpoint.transport.jaxrs.MessageBodyHandler.readFrom(MessageBodyHandler.java:56)
com.dieselpoint.transport.jaxrs.MessageBodyHandler.readFrom(MessageBodyHandler.java:1)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:256)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:235)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundReadFrom(MappableExceptionWrapperInterceptor.java:74)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
org.glassfish.jersey.server.ContainerRequest.readEntity(ContainerRequest.java:271)
org.glassfish.jersey.server.internal.inject.EntityParamValueFactoryProvider$EntityValueFactory.provide(EntityParamValueFactoryProvider.java:96)
org.glassfish.jersey.server.spi.internal.ParamValueFactoryWithSource.provide(ParamValueFactoryWithSource.java:71)
org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:94)
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(JavaResourceMethodDispatcherProvider.java:127)
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
org.glassfish.jersey.server.model.ResourceMethodInvoker.access$100(ResourceMethodInvoker.java:102)
org.glassfish.jersey.server.model.ResourceMethodInvoker$2.call(ResourceMethodInvoker.java:336)
org.glassfish.jersey.server.model.ResourceMethodInvoker$2.call(ResourceMethodInvoker.java:333)
org.glassfish.jersey.server.ServerRuntime$AsyncResponder$2$1.run(ServerRuntime.java:893)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.process(Errors.java:267)
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
org.glassfish.jersey.server.ServerRuntime$AsyncResponder$2.run(ServerRuntime.java:888)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
#4:
io.netty.buffer.AdvancedLeakAwareByteBuf.readByte(AdvancedLeakAwareByteBuf.java:399)
io.netty.buffer.ByteBufInputStream.read(ByteBufInputStream.java:109)
org.glassfish.jersey.netty.connector.internal.NettyInputStream.read(NettyInputStream.java:136)
org.glassfish.jersey.message.internal.EntityInputStream.read(EntityInputStream.java:92)
org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream.read(ReaderInterceptorExecutor.java:286)
... more of same ...
The text was updated successfully, but these errors were encountered: