cockroachdb / swiss

Go port of Google's Swiss Table hash table
Apache License 2.0
317 stars 12 forks source link

Question: Does swissmap shrink on key deletion? #38

Closed Jakobovski closed 2 weeks ago

Jakobovski commented 3 weeks ago

Does swissmap suffer from the same key-deletion issue as golang map? Namely memory is not freed upon deleting of keys?

See https://github.com/golang/go/issues/20135

petermattis commented 2 weeks ago

swiss.Map has similar delete behavior to Go's builtin map. The Map grows during insertion, but does not shrink during deletion. However, deleted pointer values can be Gc'd. So can the memory associated with string keys.