{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/183","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/183/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/183/events","html_url":"https://github.com/spring-cloud/spring-cloud-consul/issues/183","id":154023137,"number":183,"title":"Memory leak with Consul Config Watch","user":{"login":"nickcodefresh","id":5837418,"avatar_url":"https://avatars.githubusercontent.com/u/5837418?v=3","gravatar_id":"","url":"https://api.github.com/users/nickcodefresh","html_url":"https://github.com/nickcodefresh","followers_url":"https://api.github.com/users/nickcodefresh/followers","following_url":"https://api.github.com/users/nickcodefresh/following{/other_user}","gists_url":"https://api.github.com/users/nickcodefresh/gists{/gist_id}","starred_url":"https://api.github.com/users/nickcodefresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickcodefresh/subscriptions","organizations_url":"https://api.github.com/users/nickcodefresh/orgs","repos_url":"https://api.github.com/users/nickcodefresh/repos","events_url":"https://api.github.com/users/nickcodefresh/events{/privacy}","received_events_url":"https://api.github.com/users/nickcodefresh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":63,"created_at":"2016-05-10T14:39:31Z","updated_at":"2016-11-14T15:03:00Z","closed_at":null,"body":"I raised the following issue on Stackoverflow because I was experiencing my Spring Boot app just eating away at the heap\n\nhttps://stackoverflow.com/questions/37137358/huge-org-springframework-boot-loader-launchedurlclassloader-memory-usage\n\nAfter investigation is appears as though Consul is returning a changing `X-Consul-Index` header value when requesting KVs that do not exist.\n\nFor example `http://consul:8500/v1/kv/mio/application,server/?recurse&wait=2s&index=281722`, where `mio/application,server` is the default content and one of the active Spring profiles. 281722 was the index value returned from the previous call, and Consul may now return a completely different value.\n\nA changing `X-Consul-Index` value causes the Spring Cloud to refresh the context (via `org.springframework.cloud.consul.config.ConfigWatch#watchConfigKeyValues`), which in turn creates a new instance of `org.springframework.cloud.consul.config.ConsulPropertySourceLocator`. For whatever reason, the old instance of ConsulPropertySourceLocator aren't garbage collected, leading to a memory leak.\n\nI'm using Spring Boot c1.3.2.RELEASE, Spring Cloud vBrixton.RC2 and Consul v0.6.4.\n\nAt the moment the only way round this for us is disable config watch via `spring.cloud.consul.config.watch.enabled`\n"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/comments/260357921","html_url":"https://github.com/spring-cloud/spring-cloud-consul/issues/183#issuecomment-260357921","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/183","id":260357921,"user":{"login":"dahamr","id":22028496,"avatar_url":"https://avatars.githubusercontent.com/u/22028496?v=3","gravatar_id":"","url":"https://api.github.com/users/dahamr","html_url":"https://github.com/dahamr","followers_url":"https://api.github.com/users/dahamr/followers","following_url":"https://api.github.com/users/dahamr/following{/other_user}","gists_url":"https://api.github.com/users/dahamr/gists{/gist_id}","starred_url":"https://api.github.com/users/dahamr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dahamr/subscriptions","organizations_url":"https://api.github.com/users/dahamr/orgs","repos_url":"https://api.github.com/users/dahamr/repos","events_url":"https://api.github.com/users/dahamr/events{/privacy}","received_events_url":"https://api.github.com/users/dahamr/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T15:02:59Z","updated_at":"2016-11-14T15:02:59Z","body":"Maybe we aren't doing the same thing to reproduce. I ran the app using SB 1.4.2 and it showed accumulating AnnotationConfigApplicationContext objects every time a refresh event is triggered. I'm using a simple curl command in a loop incrementing the test value each time. I installed YourKit as well to see if it shows anything different and it does not. "}}
{"actor":{"display_login":"dahamr"}}