v icon indicating copy to clipboard operation
v copied to clipboard

`select` memory leak when compiled with `-autofree`

Open rpsrosario opened this issue 4 years ago • 0 comments

V version: V 0.2.2 b07f373.21bf8fe OS: windows, Microsoft Windows 10 Home v19042 64-bit

What did you do? Ran the following program, compiled with the -autofree flag:

fn main() {
	r := go run(chan int{})
	r.wait()
}

fn run(ch chan int) {
	for {
		select {
			v := <-ch {
				println(v)
			}
			else {}
		}
	}
}

Opened the task manager and watched the memory consumption for the created process.

What did you expect to see? The memory usage to remain constant.

What did you see instead? The memory usage consistently increasing.

rpsrosario avatar Feb 17 '21 22:02 rpsrosario