I've been running some pretty heavy continuous soak tests using this sampler and I've discovered a memory leak related to the connectionList declared in the ServiceSocket class. Basically what I am doing is looping my threads infinitely and each WebSocketSampler has a unique connection ID for debugging purposes.
Overtime the connectionList HashMap is gradually filling up resulting in the JVMs heap overflowing with redundant references. I've implemented a fix locally that just removes the connection from the collection when it is closed:
@OnWebSocketClose
public void onClose(int statusCode, String reason) {
<output omitted>
close(StatusCode.NORMAL, "JMeter closed session.");
parent.getConnectionList().remove(connectionID); // Remove from collection to prevent leakage.
}
I've been running some pretty heavy continuous soak tests using this sampler and I've discovered a memory leak related to the connectionList declared in the ServiceSocket class. Basically what I am doing is looping my threads infinitely and each WebSocketSampler has a unique connection ID for debugging purposes.
Overtime the connectionList HashMap is gradually filling up resulting in the JVMs heap overflowing with redundant references. I've implemented a fix locally that just removes the connection from the collection when it is closed: