V: out of memory: Terminated by signal 9 (SIGKILL)

Created on 4 May 2020  路  2Comments  路  Source: vlang/v

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.

Bug

Most helpful comment

Good find, I've been working on something related. Will fix.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArcDrake picture ArcDrake  路  3Comments

oleg-kachan picture oleg-kachan  路  3Comments

choleraehyq picture choleraehyq  路  3Comments

XVilka picture XVilka  路  3Comments

shouji-kazuo picture shouji-kazuo  路  3Comments