Video memory has been exhausted

I was getting the same thing i was testing how much folliage i could paint in my scence and had over 300k of grass, i deleted it and it fixed the problem however now it has randomly come back yet i havent added anything into my scene but it says expect extremely poor performence so does that mean im loosing frames when testing my game packaged. All i did before it came back was add sections of my map into levels in the level streaming which makes no sense why that would cause more gpu usage it is just for loading the map without crashing.

I realise this is an old post, but this is still an issue i have today. I have followed the previous steps with no improvement…

Is there any update on ways to cut back the VRAM usage while using Nanite and Lumen? My seemingly light project is being crushed, while i have 8GB of VRAM

1 Like

I usually type " r.streaming.poolsize 99999" and it comes back to normal, if it doesnt come back to normal I simply close the UE5 and restart it. Make sure you type the console command as soon as you open the editor. You can also do that in the .ini file but I dont remember what file or what piece of code to add.

1 Like

Restarting UE makes the problem go away, But as soon as i start opening a couple textures it comes back. The Textures are 8k but use nanite, and are closed after editing but its almost like everything stays loaded into memory or something?

I have set the streaming pool size to 8000 which almost matches my VRAM (Which is what its suppose to be right?) But I’ve seen it perform better when set to 3000??

Yeah, the reason this happens is because Unreal loads a LOT of cached data for quick retrieval. In an actual game, most of these assets are not preloaded.

Any time you open an asset, it loads everything that is related to that asset or adjacent to that asset, which is why the longer you work in Unreal, the worse the performance gets.

There’s also garbage collection, which does not happen instantaneously.

When you package a game (assuming the code is sound), it will run MUCH smoother (again, because it’s not preloading animations, textures, materials, etc. all at the same time).

Also, when you feel comfortable, start learning optimization, if you haven’t already.


But why is it occasionally working better when designated less? This is my scene which is comprised of ~4k Nanite objects, some foliage(With LODs) and a Bridge but my VRAM is overdrawn.

Am I tweaking out and underestimating my performance needs?

I can barely continue work on this small scene because everytime i want to open or add an asset to the scene, it takes ~40 seconds

We both use 3060ti, but take a look at my total GPU and Shared Memory.
That’s your problem:

A good fix is to lower the Engine Scalability Settings:

1 Like

I don’t understand what you mean, our shared memory usage is quite similar in that regard?
My engine scale is set to High, and any lower causes my lighting to become really dark.

Shared memory (CPU + GPU) helps relieve some of the graphical stress from the GPU. alone. You have virtually no free (CPU) memory, so your 3060ti is working real hard.

What CPU do you have?
And how much system RAM?

Also, are you running videos in the background?
Google Chrome is actually very expensive on the system.

Ryzen5 3600x and 16 GB Ram both running PBO OC. My Ram stays around 13GB so i have some headroom still. My Shared GPU Memory was the same as yours, and generally i haven’t seen it be used by Unreal.

I get the error even when i cut firefox and starting desktop windows manager.exe . It just keeps eating it up.

Then there’s a memory leak.

Is the asset from Quixel or the Marketplace?

I’m pretty sure there isn’t a memory leak otherwise i’d have issues outside of Unreal.
All my assets are from Quixel.

No, I meant, a memory leak with the asset itself.
Poorly optimized assets can bloat memory usage.

If you got them from Quixel, I’d say they’re pretty safe.
I think you’ll need to do the following:

  1. Take note of your CPU/GPU before opening Unreal
    1a) And of course during, but more importantly AFTER.
    1b) If usage is still high after it’s closed, it’s not an Unreal issue. If usage is no longer high once you have closed the application follow these steps:

  2. Using the frame rate tool, see if the framerate improves as you move the camera away from the assets/actors.

  1. Checking system usage with nanite view (triangles)

Moving away from the materials should make the triangles larger.

  1. Check the shader complexity:

If the lighting gets dark with lower graphical settings, you can use a post-process volume to correct this. You say you have the same amount of Shared Memory, so considering how small your scene is, this is VERY unusual.

Report back with your findings.

Don’t forget, it’s not only what you put on-screen that takes up space. If you have a large project, Unreal has them cached for quick retrieval/loading in the background.

Will Epic ever fix these major performance problems?

3 Likes

If you guys want a quick fix just type “R.streaming.poolsize 9999” in the console, this should make the memory exhaustion go away and the textures will come back at full resolution. You can also change this on the baseengine.ini I think, so you dont have to be constantly typing this everytime you open unreal.

1 Like

The problem with this technique is that it will DEFINITELY cause a crash.
(Universal) You must find out what’s causes the excess memory.

There is no “cause” to the out of VRAM problem as this even happens on blank projects, Blank as in the ‘Blank Template’ from the ‘New Project Menu’.

This can even happen on 3090s and 4090s which have 24!GB of VRAM. The root cause is the engine itself. Epic needs to have a look at this as this is not what is called PRODUCTION READY, it’s hard to be PRODUCTIVE if the engine keeps crashing within minutes. There are still bugs that date back to the earlier UE4 days.

Another good indicator that it is nothing related to assets or hardware is that all of the crashes stop immediatley if you switch the RHI to Vulkan (which still uses Nanite and Lumen) but the problem there is that performance is generally cut in half in most scenes because Epic is unable to implement it properly.

Epic just needs to stop putting useless new ■■■■ into the engine and start fixing whats already there. The Early Access period of this engine is officially long over and even then, the Early Access version was WAY more stable than all versions after it upto the most recent 5.1.1.

They just very shoddily implemented the different render api’s and thats whats causing the problem. And at the very least, the engine should be able to detect the available VRAM and limit everything accordingly as does almost every game on the market.

For a recent example and to stay in the same engine, Hogwarts Legacy, if i set the Textures to the MAX and on top of that ENABLE RAYTRACING at 4k, i’m around 4gb OVER my available VRAM but does the game crash? No, not even after a multiple hour long play session, yeah it start’s to run like crap in certain places because of the constant swapping between system memory and vram, but does it crash? No not a single time! And this is how it should behave and that game uses a modifed version of UE4.

Even when disabling all of the fancy new mostly non-working features the engine keeps constantly running out of VRAM whereas the same scenes worked just fine in UE4. To top it all of, i even tried importing the same exact Megascans with 8K textures into UE4, no problems at all, in UE5 immediate ‘Out of VRAM’ errors even with the same base settings (Nanite, Lumen, Virtual Textures disabled to match UE4’s default settings).

Over the last couple of months i’ve sent them around 4GB worth of logs and crash reports and i have yet to see any response to that. They just don’t care!

6 Likes

What can ease this issue is writing: “R.Streaming.PoolSize 0” in the console commands.
What causes this according to some folk is that, like UE4, UE5 is constantly caching everything you open up in your project, to facilitate loading times while CREATING your project.
Thankfully this issue only affects us devs! When you package your project and release it as a final product, it doesnt happen! Or at least it should.
We will have to endure with this issue :frowning:

1 Like

“UE5 is constantly caching everything you open up in your project, to facilitate loading times while CREATING your project.”

THIS.

As I have also said.

All of the load caching in the background is what causes this issue, generally. Unreal sees the free RAM and uses it immediately.

HOWEVER, I do encourage other users to get into the practice of checking for data leaks and memory hogs before simply blaming it on Epic.

4 Likes