3 ms·
func main() { // Create a large heap allocation of 10 GiB ballast := make([]byte, 10<<30) // Application execution continues }
by karlnowak 7y ago
func main() {
// Create a large heap allocation of 10 GiB
ballast := make([]byte, 10<<30)
// Application execution continues
}
- bboreham 7y ago10<<30 is a lot. Perhaps you meant 2<<30?
- Dylan16807 7y agoAre you confusing shifting with exponents? 10<<30 is exactly five times bigger than 2<<30.
- bboreham 7y agoYes, I did.