You can measure the outbound queue length, correct?  Limit it to X number
of Write Requests then throttle it yourself by pausing the inbound.

On Wed, Aug 30, 2017 at 2:55 AM, Juan Palacios <[email protected]>
wrote:

> Hi,
> Today I created DIRMINA-1070
> <https://issues.apache.org/jira/browse/DIRMINA-1070>, but I wanted to
> reach
> out to the list to see if anyone could provide any insight into how we can
> handle this issue in the mean time.
>
> As a short description, when a client connects to our MINA server and
> specifies a large window size (TortoiseGit for instance uses 2GB) it
> results in an OutOfMemoryError. Apparently because the
> DefaultWriteRequestQueue uses an unbounded queue, the server writes data
> without any throttling and if the client is unable to keep up the heap is
> eventually consumed and the error happens.
>
> I've looked at implementing an IoFilter to try and handle filterWrite and
> messageSent (to make sure only a fixed maximum number of bytes are ever
> in-flight) but apparently the calls might be unbalanced because a lot more
> bytes came  through the messageSent call than they did through the
> filterWrite call.
>
> I'll appreciate any help you can provide.
>
> Cheers!
> Juan
>

Reply via email to