# EndFlushResourcesRHI Spike in empty 5.3.2 and 5.4.3 project

**URL:** <https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** unreal-engine, question\
**Created:** [August 18, 2024, 5:20pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750 "2024-08-18T17:20:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Momentimes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Momentimes](https://forums.unrealengine.com/u/Momentimes)\
**Post date:** [August 18, 2024, 5:20pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/1 "2024-08-18T17:20:45Z")

</div>

Hello hello! I am getting big hitches in game caused by something relating to EndFlushResourcesRHI, I am testing in standalone game but the same issue happens with in editor traces. I’ve tried switching graphics drivers, disabling/enabling g-sync. The photos attached are from empty thirdperson 5.4.2 and 5.4.3 projects. I have also tried disabling both nanite and lumen. Any help is much appreciated!

 ![insights04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/5/cf5f5198d4aa8eb9eef8747bc57515c996371c85.png)  
 ![insights03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/1/4c165b15a5885f06f00851eca49b43cef80687b7.png)  
 ![insights02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/7/407215b2cdfbc60d381585be5e97b7be5b616e47.png)  
 ![insights01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/b/65bbb22ca130e968fd1cf34eee6f53b549eb6653.png)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [August 18, 2024, 5:51pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/2 "2024-08-18T17:51:42Z")

</div>

It’s basically telling the graphics card to clear out resources via

```auto
RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThreadFlushResources);

```

Inside the flush command it also waits for tasks to finish before it can dump the data to prepare for fresh render commands.

Seems epic did a lambda rebuild inside of the class. Not sure how optimized it is, but it seems to have quite a lengthy comment regarding how things had to be moved to delegates to have the correct execution.

It’s probably waiting for tasks (compute shader calculations and other shader effects) to end before it can finalize.

Is your scene changing drastically at high speed, changing shaders at a fast pace? Dumping and uploading whole shaders at a time. Are the shaders very complex? (how does your shader complexity look via F5 is it green or lots of red)

---

<div class="post-metadata">

**Author:** ![Momentimes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Momentimes](https://forums.unrealengine.com/u/Momentimes)\
**Post date:** [August 18, 2024, 5:57pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/3 "2024-08-18T17:57:26Z")

</div>

Thanks for replying! In the default third person project I was moving my camera around but I think it still happens if you just stand there.

I have just been testing global illumination and it might be happening at any value higher than 1 quality setting for it. Doing more tests and setting it just to 1 causes the spike to go away in my initial tests.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/8/808e80de4b78f36ba80690f5ac3a76cb8007c63a.png)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [August 18, 2024, 5:59pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/4 "2024-08-18T17:59:07Z")

</div>

It’s also triggered by texture streaming. So on a smaller scene you could try turning off streaming and see if the spike occurs. (OFC not viable in larger projects)

---

<div class="post-metadata">

**Author:** ![Momentimes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Momentimes](https://forums.unrealengine.com/u/Momentimes)\
**Post date:** [August 18, 2024, 6:04pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/5 "2024-08-18T18:04:01Z")

</div>

Just tried epic all scalability and texture streaming off and the spikes were definitely lessened

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/b/2bbb02093ab8112ef637e060ce694f80be8b3c37.png)  
This is the scene for example, almost all assets are sharing the same texture sheet and are vertex colored. Maybe the texture streaming was glitching out because of this?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/e/05e7f22a40db629d2cd205163a14e2cf31c1a6b6.jpeg)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [August 18, 2024, 6:09pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/6 "2024-08-18T18:09:08Z")

</div>

You can try optimizing the streaming via ini files

> [@How to Improve Texture Streaming GPU performance in UE5 over 20% increase on GPU memory \[Solved\]](https://forums.unrealengine.com/t/how-to-improve-texture-streaming-gpu-performance-in-ue5-over-20-increase-on-gpu-memory-solved/267023):
>
> In my research into Windows TextureStreaming and Visual Studio 2022 17.1 performance. I have found that adding setting in the config file D:\Program Files\Epic Games\UE\_5.0EA\Engine\Config\Windows\ WindowsEngine.ini The following lines contained [TextureStreaming] ; PoolSizeVRAMPercentage is how much percentage of GPU Dedicated ;VRAM should be used as a TexturePool cache for streaming textures (0 - unlimited streaming) PoolSizeVRAMPercentage=70 When looking at the GPU Performance in Wind…

---

<div class="post-metadata">

**Author:** ![Momentimes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Momentimes](https://forums.unrealengine.com/u/Momentimes)\
**Post date:** [August 19, 2024, 10:17pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/7 "2024-08-19T22:17:51Z")

</div>

I have been doing more tests and the issue is still occuring, it happens in default third person unreal projects in 5.3.2 and 5.4.3, so at this point I don’t know what to do.

---

<div class="post-metadata">

**Author:** ![Momentimes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Momentimes](https://forums.unrealengine.com/u/Momentimes)\
**Post date:** [August 20, 2024, 2:48am UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/8 "2024-08-20T02:48:23Z")

</div>

Yo again! I stripped out almost all of my gameplay logic, and have all unreal insight channels enabled and events. What is causing this Spike? I figured out one of the spikes is caused by RHI, which [Wait For Task taking too long in Development Build - #12 by MadaraAlmighty](https://forums.unrealengine.com/t/wait-for-task-taking-too-long-in-development-build/1962909/12) is being fixed in the next hotfix. But what about this one? seems to be nothing causing it.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/e/4ce9b2eaf364ee64680b38946183e2cc624705d8.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/9/b19e364d6df7c5c4145cf0430f6819c30ce82edd.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/8/b088b71a4003e61eede9b84978ff5d90a096e3bb.png)  
Only thing in that space is quartz clock, frame, and engine tick

---

<div class="post-metadata">

**Author:** ![snowy0110](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@snowy0110](https://forums.unrealengine.com/u/snowy0110)\
**Post date:** [October 16, 2024, 4:08pm UTC](https://forums.unrealengine.com/t/endflushresourcesrhi-spike-in-empty-5-3-2-and-5-4-3-project/1981750/9 "2024-10-16T16:08:16Z")

</div>

☹ I was forced to update from 5.3 to 5.4 because of Google Play Market rules.  
As soon as I did that, I have lost my 60 fps and now it is 50. Noticable difference. As soon as I add more content to the game, it starts being too sluggish. :\

utrace on 5.4:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/7/f27cf3c566fd2f5a2cf74799b6c65a561c282419.jpeg)  
utrace on 5.3:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/2/fd2f6a5d76e750e41a57cb393cb88f62b398c1ed.jpeg)

Android Vulkan, POCO X3 phone
