Why does unreal engine require too much RAM ?

I have zero knowledge in game dev. All my exp is in C++, Qt, Linux dev and other stuff. I have never done game dev before.

I was wondering why the person who wrote the unreal engine docs require this ridiculously high amount for RAM (32GB) for unreal engine on Linux.

  1. Is it cuz the engine has great parts of it written in an interpreted slow resource eating language ?

OR

  1. The engine is really efficient, written in a compiled language that respects the user’s resources … but the engine is really big and loads lots of stuff in the RAM ?

Which case from the above is unreal engine ?

In any code i write, i prefer as much as possible to use C, C++ or Rust, a compiled language that will be as resource efficient as possible, use only the needed RAM and CPU to do the task, so that the user’s resources are respected, even if i will spend more time writing the app. This will eventually allow the user to run more light-weighted apps at once on one device, improve startup time etc.

Also in the engine github repo, the percentage of the languages used in the engine are not visible !
What are the percentages of the languages used in the engine ?
How much RAM does the engine use initially when it starts up ?

I exclusively use unreal on linux and have only seen it go above or near 32gb during compile or with huge landscapes. But afaik the build system will limit the parallel build processes based on memory.

Also you should factor in just how much the editor can do. Its pretty efficient imho for what it offers, fitting all it does in the rather small amount of ram is impressive. 32gb is not ridiculously high for game development of serious games.

Ram usage in a packaged builds of my game on linux is much lower. The only time I’ve seen high ram usage come into play is compiling the editor or using the editor with large scene. On void linux with a decent size open world with a large amount of foliage and AI characters the editor is using around 4gb RES for me.

2 Likes

Ok, so help he get a clearer picture. If i wanna rebuild a game like Manhunt 2 (released in 2007) but with better graphics and better functionality, not wow stuff, but better to just adapt to 2023.
How much RAM do you think i will need for development ?
How much RAM will the game need to run after building ?
Just give me rough estimates based on your experience …

The laptop i have is ASUS ROG Strix G16 (2023):
CPU: i9-13980HX (24 cores - 32 threads)
RAM: 16GB DDR5
GPU: ‎NVIDIA GeForce RTX 4050 (2560 cores - 6GB RAM)

How do you think development will be on such device ?

As you can trivially find out, Unreal Engine is written in C++.

The reason the Unreal editor requires a minimum of 32 GB of RAM, is the same reason that any other large content creation tool requires a lot of RAM: Content is big!

On Linux, especially, the graphics drivers in the kernel tend to want to keep one copy of every texture or vertex buffer or other object in main RAM, and another copy on the graphics card (because the OpenGL API requires this, for technical reasons!) whereas on Windows, the DXGI infrastructure can “move” certain objects onto the graphics card directly, freeing up some system RAM. This can explain a slightly bigger footprint on Linux that Windows, specifically. But, even on Windows, it’s usually a good idea to have at least 2x the system RAM as you have video RAM, and ideally 4x or more. With an 8 GB RAM graphics card, this means 32 GB of system RAM.

Additionally, content, during development, is generally bigger than content, once optimized and baked down to runtime game format. There’s a number of reasons for this, and it’s not always true, but it’s frequently the case that you’ll need 4 MB in editor for something that’s 1 MB when baked for release.

The excruciating technical details are all available if you check out the source code from GitHub, build it yourself, and step through the various functions of the engine. I highly recommend it – it’s very, very, educational! (And there’s a lot there …)

2 Likes

Once the 6 GB graphics card backup is taken out of your system RAM, you only have 10 GB system RAM left. I think your laptop has too little RAM, even for just playing modern games on Windows, much less doing content development on Linux.
And, again, when I say “system RAM backup” I do not mean shared framebuffer like you’ll see on integrated graphics, I mean the additional working area the graphics drivers prefer to use (and, on Linux, must use) for high performance.

2 Likes

this is correct. afaik the engine predicts about 1.5g of ram per process.
so if you have a 32 threads cpu you will want to have more ram than 32g. specially since there are other software always open.
and that’s basically an issue from the compiler itself.
ue will work with less ram, but will reduce the amount of processes, giving you considerably less performance during certain tasks (compiling code, shaders, and others (maybe lights and landscapes), and maybe the new multi process cook).

Packaging and cooking is another very intensive process that might benefit from more ram.

other factors to take into account:

  • debug/development builds could use more ram/disk and are slower, which is the norm while developing.
  • blueprints (afaik) have a sort of virtual machine on top, (or an extra layer of communication), which consumes ram.
  • there’ s also python automation scripts which could translate to more ram.
  • other software you might need open:
    • the IDE for developing can use a lot of ram (vstudio/rider). mine uses like 20g sometimes.
    • the IDE during a debug session could hold even more ram necessary for such process (e.g. when attached to a build or editor).
    • the browser. is not a trivial piece of software and consumes ram indiscriminately.

I think those are the main reasons they recommend such a number. not because ue itself uses it all the time, but because the whole environment needs it.

but also as mentioned, content is big and sometimes needs to be in ram, as well as metadata.
some data types are complex in raw form but small when cooked, but the editor needs to be able to handle them in raw form (meshes, sounds, images, etc).

i have had exp in Qt (which btw is my favorite app framework <3) but the content you handle with it is far less complex than what you handle in UE (imho).

also worth noting that UE itself, when compared to other 3d engines, not only it has a considerable surface (as in lots of big pieces), but also quite complex (e.g. lumen, nanite, umg, metasounds, etc. are not trivial in their implementations).

i think it’ s pretty efficient how it’ s architectured (i’ m not an expert on the internals), it’ s divided into modules and plugins. This is quite flexible and allows for compilation in pieces but also can require more ram to interface or compile.

Another reason is that UE has plenty of optimizations, and sometimes the tradeoff is memory Space–time tradeoff - Wikipedia
One example of this is UnityBuilds (not to be confused with another engine), these are way faster than compiling one .cpp at a time, but requires a lot more ram comparatively.
(i did the test with 32 threads with the same ram and cpu for both types of build, and the time difference is absurd, it basically comes down to overhead, i think.)

you can reduce the amount of ram used to compile and run the editor (and the game) if you disable plugins you (know you won’t) don’t need. Though for beginners i’m not sure i’d recommend it, because when you disable a plugin that functionality is not shown in the UI, so you might never know it exists until late.

note:
most of my experience is using Linux, but i also work with Windows sometimes.
Normally with my ide, browser, UE and other minor apps open my ram is about 25-40 gib usage, on KUbuntu. i usually use debug or development builds of my project and sometimes the engine.

on the current project im working on windows atm ue editor itself is only using 3gib of ram, the browser 2, and the ide 10.

considering blender recommends 32gb of ram, i don’ t think ue is too far off.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.