Skip to content

NioSocketChannel$WriteRequestQueue has no limit and is causing OutOfMemory #574

@rpelissier

Description

@rpelissier

I am using Netty to perform large file upload. It works fine but the RAM used by the client seems to increase with the size of the file. This is not the expected behaviour since everything is piped from the Reading the source file to writing the target file.

At first, I thought about a kind of adaptive buffer growing up until Xmx is reached but setting Xmx to a reasonable value (50M) would lead to an OutOfMemoryError soon after starting upload. After some research using Eclipse Memory Analyzer, it appears that the object retaining the heap memory is:

org.jboss.netty.channel.socket.nio.NioSocketChannel$WriteRequestQueue

Is this the expected behaviour, is there any option for setting a limit to this queue or do I have to code my own queue using ChannelFutures to control the number of bytes and block the pipe when the limit is reached?

Thanks for your help,

Regards,

Renaud

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions