• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

PC Memory leak with level loads, wave progression

Maxim

Member
Oct 15, 2012
9
0
Category: Code

Reproducibility: Always

Summary: With level loads, or endless wave progression, memory is consumed slowly in about 10-30 MB chunks until all available memory is consumed.

Description: Throughout game play, KF2 will consume more and more memory, eating up available RAM, and then move into swap, until no available memory is left at which point the OS will lock up.
  1. Open KF2
  2. Select Play Solo Offline on the main menu.
  3. Select Starting Map Biotics Lab
  4. Select Game Mode Endless (or Survival)
  5. Select Difficulty Normal
  6. Click Launch Game
  7. After level loads, select Ready Up
  8. Die
  9. Wait until summary screen appears showing awards, etc.
  10. Observe consumed memory
  11. Select Biotics Lab from Map Vote summary tab
  12. Repeat steps 4-8
I've observed this memory leak occurring for a while, I speculate as long as I've been playing KF2, I don't think that there was a recent change that's making this happen. I thought for a while it was my video card overheating or some other component overheating. After ruling these out through experimentation/trial and error, I started to look at system resources while playing. I noticed that whenever my system would lock up, my RAM and swap would be completely full. Yesterday while playing Elysium in Endless mode, I watched the memory steadily creep up until it finally reached capacity and the system started to choke, and I was able to exit KF2 before the whole system locked up. After exit, I watched the RAM and swap return back to normal and the system was again responsive. This really stood out to me since in Endless mode, there is only a single level being played, so no additional assets should be required to be loaded into memory once every area is played, and at least one of all zeds have been spawned. This is a layman's assumption based on my zero experience in game development.

My options for controlled testing without automation tools is limited, so I came up with the steps above because they eliminate client/server weirdness, and variables from other players, and doesn't require progressing through any waves. I repeated these test steps 20 times and confirmed that memory was creeping up in 10-30 MB chunks, with sometimes the memory going back down, but mostly going up.

It's important to know that the game doesn't crash when this occurs, just everything completely stops, so there is no bugsplat report, nor any messages in the launch.log file that I saw that would indicate an out of memory issue.

Online/Offline: Both.