veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

Renderer seems to leak memory #498

Closed rasa-silva closed 2 years ago

rasa-silva commented 2 years ago

Running any example with a Renderer like render seems to leak memory. (at least on OSX)

veeableful commented 2 years ago

Hi @rasa-silva, could you provide the method on how you determined that the program is leaking memory? I tried with the render example and ran leaks [pid] after the program has been running for a while but it doesn't seem to show much memory leak apart from 16 bytes of memory.

rasa-silva commented 2 years ago

I just monitored it with htop and "Activity Monitor" and the value keeps rising every second

veeableful commented 2 years ago

Does it keep rising and not drop down for you? In my case, it seems to stabilize around 30-40mb. It looks to me that it’s normal allocations and Go’s garbage collection running.

rasa-silva commented 2 years ago

It seems you're right. It slowly rises during ~5 minutes but it stabilizes after that. Probably the Go runtime warming up or something like that... Sorry for the trouble. You can close this.

veeableful commented 2 years ago

I see. If you experience severe memory leaks, do let me know and feel free to reopen this!