-
Notifications
You must be signed in to change notification settings - Fork 760
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
[WASM] ... has memory leaks #17624
Comments
@jeromelaban I consider memory leaks one of the most serious issues in any software technology - I'm not sure what your perspective is though... and I'm actually surprised that there is no reaction whatsoever by the UNO team on my report/repo. In particular I would like to know:
Thanks in advance for your attention on this serious issue. |
@jeromelaban @MartinZikmund I just ran the repo above on latest UNO WASM 5.4. Good news:
Bad news though: the memory leaks still exists. Am I doing something fundamentally wrong with my repo? or are memory leaks a known issue with UNO (WASM)? |
@DierkDroth thanks for providing an update on 5.4. Our answer is the same as before with related discussions, we are not aware of specific memory leaks, and we need specific repros that demonstrates leaks to fix them. You can use the tools (Here and here) mentioned previously to determine ways to create repro cases from your own environment. |
@jeromelaban I provided you repo above which demonstrates the problem: UNO WASM runs into an OutOfMemory scenario although from my (simple) repo code all memory should be 'freed'. The repo is a simplification of my actual app where grids are populated and cleared from their data. Could you please elaborate why an UNO WASM repo is not what you needed to reproduce/analyze an issue? |
@DierkDroth My apologies, I missed that there was a repro at the top. I ran your repro, and I can see the behavior that you're seeing. The issue here is that the allocated memory is overwhelming the GC pushing it closer to the 1.5GB memory limit of WebAssembly, and the GC seems to be out of its normal thresholds to run properly. If you add the following line:
Which forces the GC to run, your repro can run indefinitely, as the GC collects released memory as part of reading of the available memory. This indicates that there is no existing memory leak for the scenario from this repro. You may want to experiment with the .NET GC parameters, as explained here, then run the GC explicitly when you know that there are large allocations that are released. |
Thanks for looking into @jeromelaban. Much appreciated. Wow that's interesting ... so the .NET WASM GC (Mono runtime) would not trigger by itself, although it's running out of memory, but needed to be called explicitly ?!? ... I consider this a strange GC strategy I browsed through the list of parameters your provided (thanks!) but could not spot any parameter which would force the GC to "get its job done" when it's starving on memory. Would you have any hint/pointer? |
This may be a question better suited for the dotnet/runtime repo, but we generally set values similar to the ones in this section in apps. It may not necessarily work properly for starvation, but it's worth a try. |
Thanks @jeromelaban. I'll look into ... FYI: adding |
Current behavior
This is in continuation of this discussion. To my surprise it actually was quite simple to create a repo which would demonstrate the problem and chase UNO WASM into an 'OutOfMemory' scenario.
I'll spare the memory profiling for the sake of simplicity. Attached repo should release memory properly between iterations, but apparently doesn't. Please start the solution in VS, take a look at the comments in MainPage.cs and run it as UNO WASM head. Make sure to open the browser console by F12.
What am I doing wrong there?
Minimal.zip
Expected behavior
No response
How to reproduce it (as minimally and precisely as possible)
No response
Workaround
No response
Works on UWP/WinUI
None
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
No response
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: