So I am new to WPF and I am having issues with my windows not releasing their memory after I open them with .Show(). I basically want to open a modeless dialog. What I see happening is the memory going up when I open the new window and then when I close it via the exit button on the top right, the memory never goes down. Any ideas on freeing up the memory?
If you are checking using the windows task manager, although the memory hasn't been released by .net, you will find it has been released by your application and can be re-used.
To make sure your application releases memory when the app closes, use Application.ShutdownMode appropriately.
Im Currently Using WPF for my project, and I noticed this near the beginning, and also saw after a while of developing that the problem resolved itself. This mainly occurs when opening new forms within the application, but the memory should be released when the Application is closed completely.
If Task Manager is saying that the Application is still open when it should be closed, then one of the forms was not properly released...
EDIT to Add: When you call a form to open, use the .Close(), even though self explanatory, I never used the .Close() and it caused this problem for me, But was fixed once I added the command.