Created
February 18, 2021 10:33
-
-
Save christian-korneck/aa632ad1c9880c402be496c640cd1562 to your computer and use it in GitHub Desktop.
golang - dummy heap allocation to prevent GC below target
This file contains hidden or 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
``` | |
// 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