{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4394","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4394/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4394/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4394/events","html_url":"https://github.com/spring-projects/spring-boot/issues/4394","id":115515807,"number":4394,"title":"Memory Leak in Stomp Relay Broker ","user":{"login":"daveburnsLIT","id":15671409,"avatar_url":"https://avatars.githubusercontent.com/u/15671409?v=3","gravatar_id":"","url":"https://api.github.com/users/daveburnsLIT","html_url":"https://github.com/daveburnsLIT","followers_url":"https://api.github.com/users/daveburnsLIT/followers","following_url":"https://api.github.com/users/daveburnsLIT/following{/other_user}","gists_url":"https://api.github.com/users/daveburnsLIT/gists{/gist_id}","starred_url":"https://api.github.com/users/daveburnsLIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveburnsLIT/subscriptions","organizations_url":"https://api.github.com/users/daveburnsLIT/orgs","repos_url":"https://api.github.com/users/daveburnsLIT/repos","events_url":"https://api.github.com/users/daveburnsLIT/events{/privacy}","received_events_url":"https://api.github.com/users/daveburnsLIT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/38","html_url":"https://github.com/spring-projects/spring-boot/milestones/1.3.0","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/38/labels","id":1109868,"number":38,"title":"1.3.0","description":"","creator":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":75,"state":"open","created_at":"2015-05-14T08:35:58Z","updated_at":"2015-11-09T12:23:24Z","due_on":"2015-11-15T23:00:00Z","closed_at":null},"comments":9,"created_at":"2015-11-06T14:34:47Z","updated_at":"2015-11-09T14:32:44Z","closed_at":null,"body":"Version : Spring Boot 1.3.0 RC1\r\n\r\nThere is a memory leak in the Stomp Relay Broker with active open stomp websocket connections. We are using a rabbitMQ backend stomp Broker. We initial noticed the memory usage pattern after running a long 10 hour endurance test.\r\n\r\nTo replicate the issue we setup a test to connect 2,000 websocket stomp connections to a RabbitMQ WebSocketMessageBroker using the Spring WebSocketStompClient. After monitoring the JVM for around 1 hour the server will either run out of memory or become unresponsive due to excessive garbage collection, then drop the connections. Profiling the JVM over this period shows a leak probably in either the reactor or netty libraries (although, afraid we’re no experts on memory leaks).  \r\n\r\nThe [attached sample application](https://github.com/stuartgreenlees/springboot-websocket-leak) (based on the Spring Websocket getting started guide for the server) demonstrates the issue. The broker/server and Java Websocket clients were executed on separate machines during the test run. The WebsocketTest starts the client websocket connections.\r\n\r\nIncluded in the sample app repo is the out of memory heap dump generated after a one hour test run. Also, the attached VisualVM screen shot shows the memory usage pattern where old gen memory accumulates even after all 2000 websocket clients are connected at the 6:10 marker. \r\n\r\n![stompbrokerleak](https://cloud.githubusercontent.com/assets/15671409/10998509/727f9ab6-848d-11e5-8196-a50a3aa54a74.png)"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/155079360","html_url":"https://github.com/spring-projects/spring-boot/issues/4394#issuecomment-155079360","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4394","id":155079360,"user":{"login":"smaldini","id":76718,"avatar_url":"https://avatars.githubusercontent.com/u/76718?v=3","gravatar_id":"","url":"https://api.github.com/users/smaldini","html_url":"https://github.com/smaldini","followers_url":"https://api.github.com/users/smaldini/followers","following_url":"https://api.github.com/users/smaldini/following{/other_user}","gists_url":"https://api.github.com/users/smaldini/gists{/gist_id}","starred_url":"https://api.github.com/users/smaldini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smaldini/subscriptions","organizations_url":"https://api.github.com/users/smaldini/orgs","repos_url":"https://api.github.com/users/smaldini/repos","events_url":"https://api.github.com/users/smaldini/events{/privacy}","received_events_url":"https://api.github.com/users/smaldini/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T14:32:43Z","updated_at":"2015-11-09T14:32:43Z","body":"Sorry for the late response, let me have a look, might be an issue with the Pooled byte buffer factory from Netty we use in 2.0.6."}}