I create a WPF project and put a button on MainWindow
write this code in click event to open new windows
SecondWindow is an empty windows without any control or code!
private void Button_Click(object sender, RoutedEventArgs e)
{
SecondWindow s = new SecondWindow();
s.Show();
}
I used jetbrains dotmemory to check memory leak
I run app till Mainwindow and take snapshot
then click button to create some SecondWindow and close all second windows then take snapshot
both snapshot were taken when just Mainwindow was oppened
why second snapshot uses more memory?
you can check this even by Windows Task Manager
What I have tried:
private void Button_Click(object sender, RoutedEventArgs e)
{
SecondWindow s = new SecondWindow();
s.Show();
}