-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new version has a memory leak #3733
Comments
I am using tinygo0.26 and also have memory leakage problems, without specifying gc parameters. |
By the way, I have tested my gateway plugin. Compared to version 0.25, tinygo0.27 not only has memory leaks but also has a performance decrease of over 30%. |
If any of you can give code to reproduce this locally, I can take a look. @Fkbqf I don't see a memory leak in the example code you gave? The memory goes up and down, this is entirely expected. You say |
This ups and downs are caused by short-term switching of test plug-ins. If we test a plug-in alone, we can see its status by stretching the timeline @aykevl The second piece of code only provides rough guesses. I am a novice when it comes to researching memory aspects. (It simply increases the memory allocation of the first piece of code.) 0.250.27 |
To be able to debug this, I really do need to have a minimal reproducer that actually reproduces the bug. If that's difficult, one thing you could do is to bisect the issue. That will likely take a while but then you know the commit that introduced the issue, which is usually a good hint what the issue is. |
Is this still happening in the latest version? |
Also affected by this. Similar to other users, when using a (simple) Wasm Plugin in an Istio Ingress Gateway, it seems that memory is leaking with 0.30. Reverting to 0.25 fixed it. |
Based on feedback from our Higress users, we found that even with 0.25, memory leaks would still occur under high concurrency. In the end, we solved the problem by switching to custom gc. |
By the way, the wasm go sdk using Higress has encapsulated dependency processing for custom gc, and provides images and makefile commands that encapsulate the compilation environment, which can be directly used for plugin compilation. The wasm plugin built based on this is also natively compatible with istio. |
Thanks for all this info @johnlanni
One question I have: are you then using the latest TinyGo with |
@deadprogram I have tested nottinygc on 0.30.0, and there is no memory leak problem, but we are currently mainly using 0.28.1. |
Thanks @johnlanni |
So in order to reproduce this, I used an example from proxy-wasm-sdk build the wasm files with the respective version:
in that envoy.yaml change the wasm file accordingly, start it with make a simple load test with siege (or some other tool) Watching memory usage using the MacOS Activity manager, it stays at 70 MB for 0.25 |
Ⅰ. Issue Description
In the Higress gateway, a large number of WebAssembly plugins compiled with TinyGo 0.25 are being used. I wanted to experience the new GC parameter in version 0.27, so when I compiled and generated WebAssembly plugins using '-gc=precise' with TinyGo 0.27, I felt that memory leaks were occurring.
So below are the different tests I have conducted.
Ⅱ. Describe what happened
Here are the source files I used to write the plugin, and I tested them with different versions and parameters.
Test source file
Plugin not enabled
tinygo0.27
Precision not enabled
Enable -gc=precise
tinygo 0.25
Ⅲ. Describe what you expected to happen
I hope to fix the issue of memory leakage in the new version.
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: