Skip to content
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

Memory Leak #98

Closed
marad opened this issue Jan 22, 2014 · 7 comments
Closed

Memory Leak #98

marad opened this issue Jan 22, 2014 · 7 comments

Comments

@marad
Copy link

marad commented Jan 22, 2014

I get below exception sometimes in version 1.5.4.

WARNING: LEAK: ByteBuf was GC'd before being released correctly. The following stack trace shows where the leaked object was created, rather than where you failed to release it.
io.netty.util.ResourceLeakException: io.netty.buffer.UnpooledUnsafeDirectByteBuf@c2c69f
at io.netty.util.ResourceLeakDetector$DefaultResourceLeak.(ResourceLeakDetector.java:175)
at io.netty.util.ResourceLeakDetector.open(ResourceLeakDetector.java:117)
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.(UnpooledUnsafeDirectByteBuf.java:72)
at io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:49)
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:133)
at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:124)
at io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:77)
at com.corundumstudio.socketio.parser.Encoder.allocateBuffer(Encoder.java:47)
at com.corundumstudio.socketio.SocketIOEncoder.write(SocketIOEncoder.java:174)
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:645)
at io.netty.channel.DefaultChannelHandlerContext.access$2000(DefaultChannelHandlerContext.java:29)
at io.netty.channel.DefaultChannelHandlerContext$WriteTask.run(DefaultChannelHandlerContext.java:906)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:744)

@mrniko
Copy link
Owner

mrniko commented Jan 22, 2014

Have you tried an 1.6.1 version?

@marad
Copy link
Author

marad commented Jan 22, 2014

Well. I've noticed that there is 1.6.1 version and we switched to it today. I'll let you know if this still happens.

@mrniko
Copy link
Owner

mrniko commented Jan 23, 2014

@marad I just added a logging of such cases. Please, use build from "master" and watch for follow warnings in your log: "Buf for message: ... has not been deallocated."

@marad
Copy link
Author

marad commented Jan 23, 2014

Thanks! I think for now we'll stick to the 1.6.1 from the maven repo. If the issue persists we'll give the most recent github version a try.

@mrniko
Copy link
Owner

mrniko commented Jan 26, 2014

please, reopen if bug repeats

@mrniko mrniko closed this as completed Jan 26, 2014
@michalkijas
Copy link

Hello. Probably the problem comes back. I use version
netty-socketio 1.6.2 with netty 4.0.17.Final

22830 [nioEventLoopGroup-3-10] ERROR io.netty.util.ResourceLeakDetector - LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 1
#1:
io.netty.buffer.AdvancedLeakAwareByteBuf.internalNioBuffer(AdvancedLeakAwareByteBuf.java:691)
io.netty.buffer.ByteBufUtil.encodeString(ByteBufUtil.java:340)
io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:660)
io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:597)
com.corundumstudio.socketio.transport.FlashPolicyHandler.(FlashPolicyHandler.java:30)
com.corundumstudio.socketio.SocketIOChannelInitializer.(SocketIOChannelInitializer.java:88)
com.corundumstudio.socketio.SocketIOServer.(SocketIOServer.java:52)
...
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
java.lang.Thread.run(Thread.java:744)
Created at:
io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:55)
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:155)
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:146)
io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:83)
io.netty.buffer.ByteBufUtil.encodeString(ByteBufUtil.java:338)
io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:660)
io.netty.buffer.Unpooled.copiedBuffer(Unpooled.java:597)
com.corundumstudio.socketio.transport.FlashPolicyHandler.(FlashPolicyHandler.java:30)
com.corundumstudio.socketio.SocketIOChannelInitializer.(SocketIOChannelInitializer.java:88)
com.corundumstudio.socketio.SocketIOServer.(SocketIOServer.java:52)
...
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
java.lang.Thread.run(Thread.java:744)

@mrniko mrniko reopened this Mar 3, 2014
@mrniko mrniko closed this as completed Mar 3, 2014
@mrniko mrniko reopened this Mar 3, 2014
@mrniko
Copy link
Owner

mrniko commented Mar 3, 2014

@skibi Very strange. Have seen in log records like?
Buf for message: .... has not been deallocated, refCnt: ....! Forcing release it!

@mrniko mrniko closed this as completed Mar 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants