Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christian-korneck/aa632ad1c9880c402be496c640cd1562 to your computer and use it in GitHub Desktop.
Save christian-korneck/aa632ad1c9880c402be496c640cd1562 to your computer and use it in GitHub Desktop.
golang - dummy heap allocation to prevent GC below target
```
// Create a large heap allocation of 10 GiB
// to prevent garbage collection gets
// triggered before the amount of heap
// allocation is reached
ballast := make([]byte, 10<<30)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment