Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maps do not shrink after elements removal (delete) #110

Closed
jiaoji100 opened this issue Sep 5, 2019 · 1 comment
Closed

maps do not shrink after elements removal (delete) #110

jiaoji100 opened this issue Sep 5, 2019 · 1 comment

Comments

@jiaoji100
Copy link

when I use delete map[somekey] in my code, I find that golang will not delete the key, but mark the key as empty instead.

Here are my questions:
when a key was marked as empty, golang’gc will not free the memory? This map may cause memory leak, Is that reasonable?

@patrickmn
Copy link
Owner

I think this is more about Go's builtins than go-cache. It seems like there's a relevant issue here: golang/go#20135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants