# Memory Leak or ??? On Mac

**URL:** <https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804>\
**Category:** Programming & Scripting\
**Tags:** UE-5, unreal-engine, bug-report, editor, question\
**Created:** [March 9, 2023, 2:41am UTC](https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804 "2023-03-09T02:41:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [March 9, 2023, 2:41am UTC](https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804/1 "2023-03-09T02:41:06Z")

</div>

Can’t see a place to post a question like this.

I was noticing my RAM getting used up while running our game, and it wasn’t released after terminating PIE. I decided to leave the game running over night and found it was seemingly leaking 2 gb per hour. I managed to use all available 64GB of RAM. I assumed my use of Hard Pointers was catching up with me, but decided to test a non-C++ default game. I started with a 5.1.1 copy of the vehicle tutorial game and let it sit running in PIE. It appeared to leak at a lower rate but still took up an extra Gig in 3 hours and was still climbing when I killed it. In the same manner as our game, the memory wasn’t released just by killing the PIE session. Only restarting the game would return it to its lower usage.

This is on a Intel MacPro and in using memreport, it appeared the only obvious large growth of memory is in Metal RHI Buffers. I would doubt this is happening on Windows or someone would have mentioned it.

I guess the question is, is it expected that a default project in PIE will grow over hours (possibly collapsing that memory usage at some later point). I need to determine if I’m doing something wrong, which as an old C programmer, I’ve alway felt my use of regular pointers to UObjects might be a suspect practice. But then seeing what seemed to be the same situation on a default stock project, confused the issue and now I’m not sure if I should do something or just file a bug report. The last thing in the world I want to do is cry wolf about a memory leak. Any other Mac Users see this happening?

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 9, 2023, 6:49am UTC](https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804/2 "2023-03-09T06:49:03Z")

</div>

Hey there @eagletree! I’ve been seeing some very sparse reports of both RAM and dedicated GPU mem spiking and not being collected. However this is the first I’ve seen from a MacOS user. Being unable to replicate all of the instances of Windows users encountering either variant, for windows I believe it’s environmental. I can’t speak at all to MacOS. The MacPro comes with an M1 right?

> [@GPU Dedicated Memory leak in DX12](https://forums.unrealengine.com/t/gpu-dedicated-memory-leak-in-dx12/783274):
>
> Hi, I wanted to make a forum post about this since I cannot find anyone else posting about having this issue in DX12 on either 5.0.3 or 5.1.1. I have made a Bug Report on the form a few days ago since noticing my issue. Initially just assumed that UE5 was just going to be heavier on resources since my general Editor experience has been a bit chunkier but recently wanted to look at GPU memory in Task Manager. Hopefully this is why I have entirely been unable to use Nanite in any capacity. I ex…

---

<div class="post-metadata">

**Author:** ![eagletree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eagletree](https://forums.unrealengine.com/u/eagletree)\
**Post date:** [March 9, 2023, 2:38pm UTC](https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804/3 "2023-03-09T14:38:05Z")

</div>

Not an M1. The MacPros we are using are the 2019 variant with Intel Xeon.

What I’m observing is pretty easy to recreate. I open a new vehicle project in 5.1.1. Open an activity monitor, selecting Mem as the sort. Press Play on project. Switch to Act Mon and note RAM usage. Click back into running game. Wait an hour (or whatever) and click back to Act Mon, noting usage and threads. If like mine, usage will have increased by a gig and the thread count gone up. Then killing the PIE session will not return the memory until the 5.1.1 editor is closed and restarted. I did this, only measured for 3 hours. On our actual game, I measured it over a 12 hour period.

If there is another Mac user who would like to try this, it would be interesting to see if they get different results.

Here is my config:

![Screen Shot 2023-03-09 at 07.47.32](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/e/5cebe851fb7a17347b7a7d71c9bbbbdf176a4138.png)

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 10, 2023, 4:20am UTC](https://forums.unrealengine.com/t/memory-leak-or-on-mac/786804/4 "2023-03-10T04:20:38Z")

</div>

Excellent data! Here’s hoping we can get more from other MacOS users. I’ll be directing anyone else I find with similar issues this way to see if we can get some more input.
