yew-wasm-pack-template icon indicating copy to clipboard operation
yew-wasm-pack-template copied to clipboard

wee_alloc can appear to leak

Open ctm opened this issue 4 years ago • 3 comments

I recently converted a piece of software from std-web to web-sys and everything went really well at least in super light testing. However, unbeknownst to me, a memory leak crept in and it turns out to happen when I use wee-alloc and have my project configured like I think yew-wasm-pack-template is demonstrating.

If I do the same thing using wasm-pack, I don't see the behavior.

I've created a repository that demos what I'm seeing. My workaround is simply not to use wee-alloc, but this behavior is surprising enough to me that I think it probably makes sense to mention it to somebody. I do, however, feel bad mentioning it here, but I think I'd feel worse mentioning it elsewhere.

ctm avatar Mar 23 '20 19:03 ctm

Haha, I appreciate you bringing this up, we should definitely figure out why this is happening!

jstarry avatar Apr 26 '20 16:04 jstarry

Just experienced this too and, after spending a few hours tracking down the cause, found this related issue: https://github.com/rustwasm/wee_alloc/issues/106

finnbear avatar Jun 19 '22 22:06 finnbear

Thanks @finnbear, @CraigMacomber, and anyone else looking into this. It's bitten so many people I feel bad I didn't chase it down a couple of years ago.

ctm avatar Jun 19 '22 23:06 ctm