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

ByteBuf.release() was not called before it's garbage-collected record while run HttpTransportTest #1002

Open
bwzhang2011 opened this issue Sep 11, 2024 · 0 comments

Comments

@bwzhang2011
Copy link

when I run HttpTransportTest and just made simple modification to the method of testMultipleMessages() :

@test
public void testMultipleMessages() throws URISyntaxException, IOException, InterruptedException {
server.addEventListener("hello", String.class, (client, data, ackSender) ->
ackSender.sendAckData(data));
final String sessionId = connectForSessionId(null);
final ArrayList events = new ArrayList<>();
events.add("420["hello", "world"]");
events.add("421["hello", "socketio"]");
events.add("422["hello", "socketio"]");
String[] responses = null;
for(int i = 0 ; i < 200; i ++) {
postMessage(sessionId, events.stream().collect(Collectors.joining(packetSeparator)));
responses = pollForListOfResponses(sessionId);
}

Assert.assertEquals(responses.length, 3);

}

I just hope to run some number of cycles as above to do simple performance test. but I got some memory-leak record with the attachment which I doubt that socketio whether or not has solved the bytebuf release problem and wonder those could lead to actual memory leak while in real production env.
socketio_memory_lead.txt

  1. I'm not sure the number of cyles should match the way to induce what happend to the memory leak
  2. You can set the env jvm parameter: -Dio.netty.leakDetectionLevel=paranoid to locate where the memoy leak
  3. The record of the memory leak mainly points to the packet.decode method like the use case for packetBuf = frame.copy(frame.readerIndex(), separatorPos)

so I need your help to point out whether I did the right way to do some simple performance test and whether PacketDecoder exists the memory leak pitfall.

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

1 participant