wasilibs/nottinygc

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

rinfx opened this issue · 3 comments

rinfx commented

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

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?

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

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.