moquette icon indicating copy to clipboard operation
moquette copied to clipboard

Avoid OutOfMemory error

Open andsel opened this issue 10 years ago • 3 comments

Use the Netty's Channel.isWritable() to avoid of memory consumption (creating WriteAndFlush runanbles) in case of slow Clients. Modifdy the structure of moquette dispatcher to buffer (limited with config param) in case of slow Channels. Differentiate for the 3 qos classes. For QoS0 the messages can be stored in memory and once exceed the limit, drop the messages, probably the same can be done for the others classes

andsel avatar Jan 17 '16 10:01 andsel

Any progress ?

ricardojlrufino avatar Oct 19 '16 14:10 ricardojlrufino

It seems like this issue has been resolved by 0.9 but was not closed. We recently ran into an OutOfMemoryException (Direct Buffer Memory) when a receiver could not process published messages fast enough.

In this case, the broker would enqueue all published messages (even with QOS0) but since the receiver was not working fast enough, the queue was growing until the direct memory size (-XX:MaxDirectMemorySize=??M) has been reached - which then throws the OutOfMemoryException.

Lunatix89 avatar Mar 02 '17 09:03 Lunatix89

It still exists in 0.9 version .After running for several hours heap memory seems to keep increasing ,finally ,it throws a OutOfMemory error.

sawyer7246 avatar Apr 14 '17 02:04 sawyer7246

Any progress ?

xinzhongtianxia avatar Jan 29 '23 03:01 xinzhongtianxia

@xinzhongtianxia Moquette has been reworked a lot since 0.9 version, now it's on 0.16, now there are queues and in flight windows, so this bug shouldn't happen again in this form, maybe if you experience some problem is another kind of bug, so please open a new issue.

andsel avatar Jan 30 '23 10:01 andsel