Memory allocation profiler in the simulator contains a memory leak when enabling automatically refresh checkbox

you can cleary see it in visual studio when debugging a game by looking at the memory graph or even in task manager itself in windows.

All you have todo is open the memory allocation profiler and enable the automatically refresh checkbox. If you disable it the process memory stops growing but as soon as you enable it again process memory grows again.

devenv_IF3edwe0oG

Eventually this could lead to a simulator crash or at the very least a very big swap file in windows if reaching out memory and windows reverting to the swap file. I already had chrome crashing due to this and other apps because memory is exhausted

initially i thought my game was causing it but number of alloced items remained the same so not sure it's related (i did not verify with other games)

Yup, when using Malloc Log the Simulator keeps references to all allocated memory to show the memory history in the list. The way it hangs on to the memory is 'unique' and will appear as a leak. Generally, only enable Malloc Logging when actively debugging memory issues. 1) it's slow 2) it will use up your system memory quickly if you're actively allocating/freeing a lot of memory in your game as you're seeing.

2 Likes

thanks for the explanation, i am indeed constantly allocating strings using formatstring and freeing them after use