It was a very simple but hard-to-spot memory leak issue with the chat window. The chat window has a maximum of 100 messages, and when that limit is reached, the oldest messages should be deleted so new ones can take their place. The issue was that the destroy call for the old message happened after the new one was spawned instead of before. This caused an infinite loop, which explains why the RAM spiked after the game froze.