Hi,   I think there is a websocket memory leak bug.   I am using the latest
version of TomEE (1.7.2).


It is easy to reproduce.  See Below, then open the index.html page in a
browser, refresh say 50 times.  

Look at the heapdump in VisualVM (after hitting the GC button a dozen
times).  Yo will find that 50 instances of MyWebsocket have been created. 
And also 50 instances of org.apache.tomcat.websocket.wsSession have been
created.  

These instances are retained because of references to them from:
org.apache.openejb.core.WebContext - creationalContext

I don't think they will ever be removed. 


STEPS TO REPRODUCE:

Create a new Websocket handler class:

@ServerEndpoint(value = "/ws")
public class MyWebsocket {

        @OnOpen
        public void wsOpen(Session session){
                System.out.println("WS Opened");
        }
        
        @OnClose
        public void wsClosed(Session session){
                System.out.println("WS Closed");
        }
}


...and index.html with javascript to open the websocket:

<html>

</html>




--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/Websocket-Session-memory-leak-tp4676663.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to