Skip to content

Instantly share code, notes, and snippets.

@lesovsky
Last active April 1, 2021 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesovsky/60050037e6163b495af9ae687230da70 to your computer and use it in GitHub Desktop.
Save lesovsky/60050037e6163b495af9ae687230da70 to your computer and use it in GitHub Desktop.
Allocates buffer and exhaust memory, to invoke OMM
package main
import "fmt"
func main() {
buf := make([]byte, 10000000)
for i := 0; i < 100; i++ {
buf = append(buf, buf...)
fmt.Println("len: ", len(buf))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment