wasilibs / nottinygc

Higher-performance allocator for TinyGo WASI apps
MIT License
64 stars 6 forks source link

--export=malloc --export=free cause memory leak #21

Closed rinfx closed 11 months ago

rinfx commented 1 year ago

TinyGo Version: 0.28.1 nottinygc Version: v0.4.0

when cgo LDFLAGS is #cgo LDFLAGS: -Lwasm -lgc -lmimalloc -lclang_rt.builtins-wasm32 --export=malloc --export=free the wasm plugin will cause memory leak.

but when I remove --export=malloc --export=free it will not.

What't the reason?

image

anuraaga commented 1 year ago

When you remove the flags, do you mean you are removing them from this line and using replace?

https://github.com/wasilibs/nottinygc/blob/main/init.go#L9

Is it possible to get a code reproduction?

anuraaga commented 12 months ago

Hi @rinfx - any more info for this issue? A repro would be great.

anuraaga commented 11 months ago

Hi @rinfx - we have released a new version that fixes memory leaks in certain situations with lots of random data. I wasn't quite able to understand your original issue, but I am going to go ahead and close this. If you still see some issue, feel free to reopen.