Last active
February 18, 2024 13:56
-
-
Save gkampitakis/77e207290a86e1d97793709a0002ac77 to your computer and use it in GitHub Desktop.
Memory leaks in Go - Unbounded resource creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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