-
Notifications
You must be signed in to change notification settings - Fork 540
Description
I raised the following issue on Stackoverflow because I was experiencing my Spring Boot app just eating away at the heap
After investigation is appears as though Consul is returning a changing X-Consul-Index header value when requesting KVs that do not exist.
For 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.
A 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.
I'm using Spring Boot c1.3.2.RELEASE, Spring Cloud vBrixton.RC2 and Consul v0.6.4.
At the moment the only way round this for us is disable config watch via spring.cloud.consul.config.watch.enabled