I have a c++ program that performs some very long-running tasks (3-level deep loop with genetic algorithm inside - about 2 hours needed to complete on my CPU). I'd like to run the program (compiled on MS Visual Studio 2019) and don't monitor it constantly but unfortunately, it freezes after some time (20-30 minutes, sometimes less). No calculations are processed since then (I can see it both on the console screen where some output should appear every 2 minutes and on Windows Task Manager when CPU usage suddenly drops). There is no message, no 'shadow window' or anything. To resume program I have to manually press "enter" key in the console and it resumes its work.
I did not find any questions like that here on StackOverflow or anywhere else. I kind of predict that this is Windows behavior to save resources from possibly unused processes, but in my case, I would like to disable this behavior and let the program run from start to the end.