# Memory leak from repreated PIE rendering, UE 4.27.2

**URL:** <https://forums.unrealengine.com/t/memory-leak-from-repreated-pie-rendering-ue-4-27-2/504044>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** unreal-engine\
**Created:** [March 4, 2022, 2:38pm UTC](https://forums.unrealengine.com/t/memory-leak-from-repreated-pie-rendering-ue-4-27-2/504044 "2022-03-04T14:38:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepsea1001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@deepsea1001](https://forums.unrealengine.com/u/deepsea1001)\
**Post date:** [March 4, 2022, 2:38pm UTC](https://forums.unrealengine.com/t/memory-leak-from-repreated-pie-rendering-ue-4-27-2/504044/1 "2022-03-04T14:38:39Z")

</div>

I have a very simple scene with an object and backdrop (about 9000 triangles in total), lit by an HDRI and a couple of area lights that I am rendering to test a number of material variations, rendering them as turntables.

I change the material proceedurally using python and invoke the PIE renderer to render the turntables at a modest resolution of 1080x1080, 168 frames. I have thousands of variations that I need to render, but the renders slow down drastically as the UE memory footprint climbs from ~4gb for the base scene at the start of rendering to about 32gb before I have to shut it down and restart.

 ![Screenshot (5)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/f/26fc04b4916e1b393f9d43c5894a70aa3995fad8.png)

The PIE renderer seems to continuously leak memory and never releases it until the editor is closed. I can’t render effectively overnight as I have to stop the script and close the editor every couple hours to free the memory.

I dumped the memreport before and after rendering a couple hundred turntables (and seeing the memory skyrocket). Once of the most interesting lines in the report seems to be this:

BEFORE:  
13243752 - StaticMesh Total Memory - STAT\_StaticMeshTotalMemory - STATGROUP\_Memory - STATCAT\_Advanced

AFTER:  
18446744073229209912 - StaticMesh Total Memory - STAT\_StaticMeshTotalMemory - STATGROUP\_Memory - STATCAT\_Advanced

!!!  
There may be other interesting things in the reports (I dont really know what I am looking for), but this was umissable as there are absurd, column-busting ORDERS of magnitude in difference.

I am rendering on an A6000, though the problem is exactly the same on another machine with a TitanRTX. Yes, I have the latest Nvdia drivers installed (511.79)

Thanks for any help or pointers on how to resolve. Let me know if you want the memreports.

* * *

There are no errors in the console during rendering and the movies look perfect, but there is this feedback that I dont know how to resolve, but I’m not sure it has anything to do with the memory leak:

LogMovieRenderPipeline: Unexpected size in FMoviePipelineSurfaceReader::CopyReadbackTexture\_RenderThread.  
LogMovieRenderPipeline: Expected size: 1080 x 1080  
LogMovieRenderPipeline: Actual size: 1088 x 1080

Nowhere in my scene do I have anything set to 1088. Camera sensor is square and output resolution is set to 1080x1080. I have no idea where 1088 comes from.

---

<div class="post-metadata">

**Author:** ![BojanglesTheLess](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BojanglesTheLess](https://forums.unrealengine.com/u/BojanglesTheLess)\
**Post date:** [March 7, 2023, 1:16pm UTC](https://forums.unrealengine.com/t/memory-leak-from-repreated-pie-rendering-ue-4-27-2/504044/2 "2023-03-07T13:16:05Z")

</div>

I can’t comment on the memory leak, but the second part with the expected size and actual size, I changed the output resolution to match the `Actual Size` from the log and I didn’t get that notification anymore. I’m guessing something is forcing the resolutions to be a certain way. In my case, this was fine.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/d/02dbf84832f0d5204539f1c89a80593625356a0c.png)
