Skip to content

Instantly share code, notes, and snippets.

@gkampitakis
Last active February 18, 2024 13:56
Show Gist options
  • Save gkampitakis/77e207290a86e1d97793709a0002ac77 to your computer and use it in GitHub Desktop.
Save gkampitakis/77e207290a86e1d97793709a0002ac77 to your computer and use it in GitHub Desktop.
Memory leaks in Go - Unbounded resource creation
var cache = map[int]int{}
func main() {
// keep allocating memory indifinitely
for i:=0; ; i++ {
cache[i] = i
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment