-
Notifications
You must be signed in to change notification settings - Fork 675
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
Memory Increases When Retrieving BindingPath.Path #9625
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Open similar issues:
Closed similar issues:
|
The mentioned concerns do not pertain to the problem I've reported here. |
Hi, thanks for posting. If you call GC.Collect() in this loop, do you still see this leak? Thanks! |
@JesseCol, Thank you for the update. We attempted your suggestion, and it did indeed resolve the memory leak. However, it introduced a performance issue. Without invoking GC.Collect(), the loop took 10 seconds to complete. Upon calling GC.Collect(), it took over 2 minutes to finish the loop. For your reference I attached the video demonstration with this update. |
Thanks! My suggestion of running GC.Collect() isn't that this would be a good way to fix the problem, it was just to see if there's a true memory leak here or if it's just that not all of the managed objects have been collected yet. It sounds like what you're seeing here is normal CLR behavior. Your loop is allocating a lot of new objects, and they won't get cleaned up until the garbage collector runs. In a real-world app, you usually wouldn't call GC.Collect() yourself, you'd just let the CLR manage the memory itself. |
Describe the bug
I have a scenario where I need to retrieve the BindingPath.Path in various parts of my application multiple times. However, when I attempt to retrieve it, the memory usage spikes significantly, from 99mb to 710mb. Once the process is completed, it decreases back to 187mb. I have attached a video demonstration showcasing the memory consumption and provided a sample for your reference.
MemoryConsumption.zip
Steps to reproduce the bug
1.Run the sample.
2.Watch the process memory in the Diagnostic Tools or Task Manager.
3.Click Check button.
Expected behavior
Memory do not want to increase that much while retrieving the path.
Screenshots
MemoryConsumption_When_Retrieving_BindingPath.mp4
NuGet package version
WinUI 3 - Windows App SDK 1.5.3: 1.5.240428000
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: