mop icon indicating copy to clipboard operation
mop copied to clipboard

memory leak

Open hujie6 opened this issue 3 years ago • 1 comments

Describe the bug

when i test mqtt proxy with many connections, memory leak appeared. image

it seems that bytebuf.release was not be called when decode msg

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]

Additional context Add any other context about the problem here.

hujie6 avatar Aug 04 '22 02:08 hujie6

case BODY: ByteBuf mqttBuf = in.readBytes(header.getBodyLength()); MqttAdapterMessage adapterMsg = new MqttAdapterMessage(header.version, header.clientId); out.add(adapterMsg); out.add(mqttBuf);

readBytes() will create a new ByteBuf, and we add it to the out list, it will be released by netty. however, when i start two thousand clients to pub and sub, mop has occasional memory leaks,and i do not know why.

hujie6 avatar Aug 18 '22 09:08 hujie6