Persistent allocation memory leaks

Aloha!

After running my game with leak detection on, I get errors about memory leaks. These stem from persistent allocations. I can find the origins of these leaks via the full stack traces and fix them.

However, I am wondering how much of an issue these leaks are. They are not growing during the game’s lifetime (and thus not increasingly consuming memory from my PC). They are simply persistent allocations made once and then never disposed. I understand that these should be fixed, but in terms of severity, do such allocations realistically cause any problem?

Hypothetically, when the game is shipped with these allocations unresolved and the user closes the game, aren’t all these allocations thrown away when the process closes anyways?

To reiterate, this is mostly a priority thing: I want to know whether I should spend immediate attention on these allocations/leaks.

Cheers :slight_smile:

I think you should still dispose them at some point like on destroy of the system. We don’t know the details of how the memory manager of these persistent allocations are handled. They may not seem to be a problem but during iteration of the game, those memory allocations might not be freed or there may be other side effects. If you have enough of this in many parts of your game, the editor could crash frequently and this would be annoying. Even if this is wrong, still err to the side of caution.

Yes, a memory leak is a memory chunk you allocate for the entirety of the process’s lifetime. So if your game does not continuously make new leaks during its runtime, you should be ok.

However as davenirline said, this can have a different effect in the editor since the process is not terminated when you restart a game.