Hello,
we experience a memory leak with the use of Jetty 9.2.21.v20170120 (we are 
still supporting Java 7). We are using the @Websocket annotation to declare our 
socket object:

@WebSocket(maxTextMessageSize = 1500)
public class SocketAnnotated {
...
}

The socket object is created in a WebSocketCreator, like this:

private class ShipWebSocketCreator implements WebSocketCreator {
@Override
public Object createWebSocket(ServletUpgradeRequest request, 
ServletUpgradeResponse response) {
ShipSocketAnnotated shipSocket = new ShipSocketAnnotated(listener, 
SocketRole.ROLE_SERVER);
....
}
}

The problem is, that when a connection is established and later closed, the 
SocketAnnotated object is not gc'ed. It seems that Jetty is internally still 
holding a reference to it. I have copied the path to the nearest gc root from 
visualvm to illustrate the problem (a screenshot can be accessed at 
http://imgur.com/a/cu7am):

this SocketAnnotated
websocket JettyAnnotatedEventDriver
incomingHandler WebsocketSession
session WebsocketServerConnection
_connection SslConnection$DecryptedEntpoint
_decryptedEndPoint SslConnection
_connection SslChannelEndPoint
attachment SelectionKeyImpl
value HashMap$Node
[0] HashMap$Node
table HashMap
tdToKey (JavaFrame) EPollSelectorImpl

I have also tried this with the latest version of Jetty (9.4.3.v20170317) but 
the problem still exists (the path the the gc root however looks slightly 
different).

I would be happy to provide any additional data needed as this is a rather 
critical problem to us.

Best regards,
rhofman
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to