-
-
Notifications
You must be signed in to change notification settings - Fork 463
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 usage... #2909
Comments
If you "never" open the UI, the process normally consumes a lot less than 150 mb. Once a WPF window has been opened and all the UI resources loaded, then as you said, you can't really control how/when the memory is released. If you close the window and leave it alone, at some point, it will go down, usually well below 50 mb. I've already taken quite a bit a time with memory profilers to make sure nothing gets leaked/held in memory when the UI is closed, and I don't think your solution would fix any real "problem" in a normal usage scenario. I prefer to leave it be and let the GC do its thing instead of fighting it over and over. |
I justed tested a few things... Reboot... no UI, two TB temp icons. When it's starting it goes up to 140Mb.. then after a few minutes it settles to around 30Mb. So rebooted again, NO UI: Open & Close UI: 130Mb. Waited 5 mins. 110Mb. Waited another 5 mins... Permanent. That's WPF, no doubt. If you;re interested I could write you a prototype for my "Controller" scenario, which runs the Wpf.Application on a separate thread when needed only. And shuts it down when the window closes... |
I would be curious if you could try it with the https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit wpf test app. Should be a relevant test for FanControl, as FanControl uses the same UI library. |
For my info is your app plain .Net or .Net Framework? And I'll test with a few XAML design frameworks. |
There are two builds: 4.8 and .NET 8 |
Lol... I've never used that particular toolkit. I've seen easier ones ;-) |
@Rem0o Et voila! |
Looked at the code, but basically all I'm seeing is lazy loading the UI stuff, which I already do, and then the only meaningful thing is "SetProcessWorkingSetSize", which I need to do some research on, as it seems quite a bit of a hack. |
I applaud FanControl. It's fantastic and very light on CPU resources. But then why is it acceptable to use sooo much memory?
I often see the app using well over 150MB.... even when the UI has not been opened, but the computer has resumed from sleep.
As a WPF developer I'm well aware of the intracies of WPf and the near impossible task of releasing memory.
The quick and dirty solution would be to restart the process and shutdown the wpf.application
In the case of FanControl I'm assuming restarting the exe will be too costly. So you'd need to separate out the wpf.App and have a controller thread running the show. Then from the Controller thread you can restart the wpf.app when the MainWindow closes.
Thanks, Jurgen
PS. Please add a manifest and make it DPI V2 aware? Takes a few minutes.
The text was updated successfully, but these errors were encountered: