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.
CodePudding user response:
I actually found the answer myself after hours of debugging and searching and it may be a little emberrassing that I didn't notice this earlier.
So you see, the software lagged whenever an Icon was loaded. This was because the Icon was a 5000x5000px image.
After scaling the image down to 128x128px everything works fine. So if anyone is experiencing this or a similar issue - check your image files first :).