I'm experiencing the issue that the RAM usage of my software spikes whenever I open a new window inside my software and the window opens delayed and somewhat laggy. This issue strangely enough only occured since I started using x64 only builds. After switching back to AnyCPU builds the issue persisted though. I've no idea what was changed when I switched to x64.
Image of lag spikes when opening windows
I've tried everything, using a different OS, machine, VS2019 instead of VS2022, nothing worked. I even tried swapping out files of my software with older files where the lag spikes didn't occur and this didn't help either.
After some more debugging I found out that it has almost certainly something to do with the Icon as the software loads perfectly fine without it.