Why do games perform better after restarts

team-fortress-2

I like to play Team Fortress 2.

My computer can run it fine on the recommended settings, but I like the best performance possible. I use a custom configuration that makes the textures look like they are from late 90s, but my game performs very well, which is what I am after.

One thing that I noticed though, is that couple hours into long sessions, the performance starts to deteriorate. I have my framerate capped out at 60 (good number; it's capped because I like consistency), and for the first couple hours it stays at 60 even during intense fights. After the first couple hours though, it starts to decrease. It would dip into the high 30s – mid 40s when I get into fights.

If I were to restart the computer, I would get another couple hours of steady 60 FPS. What I don't understand is: why? How come a restart makes my game perform better, even though my system is not running at full capacity when playing it? What is the magical thing that happens during the restart that makes the computer pick up the pace and give better performance? Is there any way to achieve those results without a restart?

Best Answer

There could be a whole host of things that causes this kind of behaviour, but the one that I would think is the most likely is memory usage. After a couple hours of playing you've probably been to half a dozen maps and played with a few dozen players; depending on how the Source Engine works with your graphics card, you might end up with a bunch of unused data floating around in your RAM or graphics card (models, textures, etc). It could be sitting there so it doesn't have to be loaded later, or because of memory leaks, but either way it's taking up space. Restarting is a surefire way to clean up this space.

Other than restarting, I don't think you have a lot of options. If the unused stuff is sitting around to be used later, then closing the game (and maybe doing something else for a bit) should unload it. If it's a memory leak (which is unlikely, but Valve's quality control on TF2 has never been award-worthy), then I don't know what else could be done.