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
I'm not sure the number of cyles should match the way to induce what happend to the memory leak
You can set the env jvm parameter: -Dio.netty.leakDetectionLevel=paranoid to locate where the memoy leak
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.
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);
}
}
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
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.