Home | Documentation | Atomic Chat | Github

Memory Leak in both Atomic Editor and Atomic Player

solved

#1

I found that there is memory leak in this commit (SHA: 73e2d0e1caadd7d384996d7226d7d63547e7727a). You can easy find out by opening a task manager and see the memory usage. It’s around 100KB per second. Can anybody help fix this issue? Thanks a lot!

Here are what I found recently:

  1. the profile metric shows no object leak
  2. memory leak gets worse in higher framerate
  3. memory leak exists in both DirectX and OpenGL version
  4. memory leak exists in both debug and release version
  5. memory leak has nothing to do with the screen resolution

Update:
The latest no-leak version is 64e3ed2e155c80fcb438d0a9258bb44cd7875dd5
while the oldest leak version is right after it: 0c52b46ca94ab222ed7a956d6da6c13d23ac9093
I guess there is something to do with the easy_profiler.


#2

After some research, I found the leak problem seems to be gone when I disable the easy profiler.
I guess it is not a leak but just easy profiler collecting the data.
My suggestion is to disable it by default and enable it in debug mode.


#3

@rokups is this a thing?


#4

Hmm i think this is both bug and not bug. Profiler collects profiling data from the start in order to give you a chance to look at possible issues at early startup. Not a single thing is missed.

Intention was for profiler to be opt-in: https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/Source/Atomic/Engine/Engine.cpp#L380

However on a second look it appears what is going on is profiler being enabled regardless: https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/Source/Atomic/Core/Profiler.cpp#L33-L48

Fix would be to call Profiler::SetEnabled(true) before Profiler::StartListen() and remove Profiler::SetEnabled() call from profiler constructor.