V version:
V 0.1.26 50a8373.c112b3a
OS:
manjaro linux amd64
What did you do?
fn main() {
for {
mut s := []int{}
for i in 1 .. 10000 {
s << i
}
}
}
What did you expect to see?
run forever, take up to 100mb ram (golang takes 72mb for equivalent)
What did you see instead?
more than 2gb ram usage and then it crashes with Terminated by signal 9 (SIGKILL)
Edit: I see, memory management is marked as work in progress, so maybe this is expected for now.
I don鈥檛 think memory is being freed automatically, try adding s.free() after the inner for loop and see if that makes a difference
Good find, I've been working on something related. Will fix.
Most helpful comment
Good find, I've been working on something related. Will fix.