hashicorp / go-immutable-radix

An immutable radix tree implementation in Golang
Mozilla Public License 2.0
999 stars 77 forks source link

Limit the size of the modified node cache #2

Closed slackpad closed 8 years ago

slackpad commented 8 years ago

While looking at https://github.com/hashicorp/consul/issues/1421 it looks like the cache had grown to a huge size and caused us to exhaust memory. We should limit the number of tracked nodes to some reasonable limit, like 16k, so common paths near the root are cached but the leaves don't cause an explosion of state.