-
Notifications
You must be signed in to change notification settings - Fork 6
There may be a memory leak when processing memory blocks containing non-ASCII characters. #46
Comments
Hi @johnlanni - very sorry for the late reply. It was tough to respond since I was hoping to come up with a better response, I think in the end it's time to be clear. There have been various memory leaks reported and fixed, but at a fundamental level without closer integration of Tinygo and bdwgc, I suspect creating an actually good GC will not be feasible. Go is very close to supporting wasm exports With that, almost any WASI binary compiled with Tinygo should be compilable with Go. For any production workload concerned with performance, it probably should switch to the official compiler. The GC is strongly tied to the compiler there and will perform much better than anything achievable with Tinygo at the tradeoff of large binaries. I plan on archiving this repo as soon as wasmexport is available in gotip. I will leave this issue open since it is indeed an issue with this repo. But unfortunately it won't be addressed and my general suggestion for the Wasm ecosystem in Go is to pause until wasmexport is available in gotip. |
Hi @anuraaga, thank you for the information and the work you have done in this repo to benefit us. |
@johnlanni I'm glad to hear that printable responses still work well. I wish I knew why 😂 When using the Go compiler with |
Based on my understanding of Go's native GC, the GC process is parallel to the execution of user code. It does not perform GC during the memory allocation process like bdwgc. Wasm does not support multi-threading. How does Go's native GC achieve this? My thought is that even if it is supported, the performance may not be better than bdwgc, because Go's GC itself is designed to run concurrently with user code. |
When I implemented the envoy proxy-wasm plugin, I found that if the response body is processed by gzip compression, a memory leak will occur. This problem also exists in the coraza-waf plugin. I suspect it may be affected by non-ASCII characters. You can use these test server program to reproduce it:
ASCII Response:
Non ASCII Response
The text was updated successfully, but these errors were encountered: