You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
package main
import (
"fmt"
)
type Node struct {
line string
unused [50]int
}
const (
LOOPS = 300 // consume ~ 1G of RAM, increase this at your own risk
MAX = 30000
STR = "1 2 3 4 5 6 7 8 9 0"
)
func main() {
for i := 1; i < LOOPS; i++ {
p := new([MAX]Node)[0:MAX]
for j := 0; j < MAX; j++ {
p[j].line = STR
}
fmt.Printf("%v\n", i)
}
}
What is the expected output?
On 64 bit Ubuntu (6g) to above program stays at a comfortable 45M memory consumption,
even for much larger values of LOOPS.
What do you see instead?
The above program consumes > 1G of RAM quickly on 32 bit systems (8g).
Which compiler are you using (5g, 6g, 8g, gccgo)?
8g
Which operating system are you using?
Linux (ubuntu)
Which revision are you using? (hg identify)
ca4f9687cec0 release.2010-10-13.1/release
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
by fibercut:
The text was updated successfully, but these errors were encountered: