Download

Out of memory issues

I am getting out of memmory issues whilebuilding for android,html5 and even while building lightning.
can any1 tell me how to fix this

Buy more memory

already have 12 gb of ram

I love this I really love this cause I known for a long time that Unreal is complete garbage at dealing with Memory.

First things first 12GB of RAM is more than enough for a Android,HTML5 game so its insane you are running low on Memory.
This is something the brilliant… people at Epic have to deal with because your not alone on that I can asure you even I deal
with low RAM issues despite the game not even being that demanding.

I don’t think there is a fix for this thought the bone heads at epic have to fix this laughable issue.

Also NO you don’t need more RAM your fine.

2 Likes

Lightmass is memory intensive and doesn’t care what platform you’re shipping on (that’s kind of the point).

Okay, the fact that he has 12 GB of RAM obviously means that physical memory is not the issue. As a matter of fact, an “Out of Memory” exception seldom has anything to do with physical memory. Usually if that is the case it is rather easy to diagnose by opening some sort of performance monitor like Task Manager. In most cases this exception has more to do with how the Operating System is managing UE4. Epic can optimize garbage collection all day but if the OS doesn’t properly handle the process(s) and its request for memory then you will continue to get out of memory errors. An “out of memory” error typically happens because a process is unable to map application data to virtual address space, also known as the hard disk.

IN other words… The amount of memory an application can access is equivalent to your disk space, not your RAM. Before even accessing RAM, the process will “request” disk space, to store the applications content like executable files or DLLs. The OS decides whether or not to store that data into RAM based on priority and frequency of use. Obviously accessing RAM is much faster than the HD, so it will attempt to “guess” which application data to store into RAM to expedite performance for the user.

However before it even allocates memory to RAM, it attempts to allocate, or map chunks of application data to virtual address space. If the OS does not properly manage the data, then the application process is unable to find a large enough section of contiguous unused address space in its virtual address space to do the requested mapping. That is when you get an “Out of Memory” exception. In other words, it is trying to allocate a chunk of contiguous memory but whilst in total there is sufficient memory, it is not all in one place. So it can’t be allocated contiguously.

Back in the 32 bit days this happened far more often because the amount of address space was much smaller. On 64 bit Windows, where the address space is billions of times larger you don’t get these errors quite as often. They can still happen though when the OS mismanages application requests.

My guess is that it is the OS. Can Epic look into fixing the issue, maybe, but I don’t think it’s UE4. Am I a Epic fan boy who thinks they can’t make mistakes in there seemingly awesome software?! No, as good as the software is, it is still open to bugs. However historical data tells me it is likely an OS memory management problem.

Imagine, thinking that the amount of memory you have in your machine is relevant when you run out of it! How charming!

To the OP, consider doing the following:

  1. Increase your Page Memory limit if it isn’t maxed out already. Read about that here: http://www.thewindowsclub.com/increase-page-file-size-virtual-memory-windows

  2. You should look into possible windows updates. First of all, are you even using windows, if so which version and what build? We could look into any potential issues people have had with your particular OS version and build.

This is an oversimplification of memory management in the OS however. To really understand it, you will need to do research.

Like I said though, I don’t think it’s Epics software, it’s the OS. So insults are unnecessary ErnestoEFL.

12GB is low. When building you’re running both the engine and the compiler which uses lots of memory, you’ll need to close other applications like your web browser and anything else you don’t need.

For building lighting it’s pretty easy to go beyond 12GB, remember it has to load everything into memory and render lightmaps at highest quality.

You need more than 12 Gb for Lightmass, it can easily go up to 25 Gb if not used correctly.
Also don’t listen to @ErnestoEFL, they are just trolling probably, that’s it.
I would really like to see you make your own engine that is more efficient.

I have used all of the top 3 Engines and Unreal is the one with the Memory issues I have never had low RAM issues with Unity and CryEngine 4 and 5, you can get as
complex as you want with this but the fact that “12GB” is “NOT ENOUGH” to me makes no sense.

Can they optimize the Engine in some way? its quite strange that Unity and CryEngine are far more superior with Memory usage than Unreal Engine 4 I made 1 game
with Unreal Engine 4 and the Memory usage on that thing just sky rocketed I of course was unable to figure out what went wrong so I started working on another game
and this one is a racing game at the moment its simple and clean with very few textures and it still runs out of RAM by using one thing the “SPLINE” to make the tracks
which is strange because when I used it the RAM just climbs up more and more, so it sure as heck aint my assets or textures cause the assets and textures are kept
at a minimum and the track and trees are the only things that has textures.

I don’t exactly know why it would be the OS’s fault on this I mean if Unity and CryEngine can handle Memory just fine why cant Unreal? I mean if anything CryEngine
does the job right I made complex tests with my game assets on CryEngine 5 because of what people were telling me that my RAM isn’t enough “WHICH IS 8GB MIND YOU”.

So I basically made a world as complex as the one on Unreal in CryEngine and that one handled it just fine with Unreal Editor the RAM is over 3,000MB which isn’t good and
with CryEngine it find ways to reduce the RAM and leaves a overall more satisfying result it was over 600MB of RAM usage which to me just feels like more smarter Engine
design versus Unreal.

Unreal is a great engine it really is but it sucks at dealing with RAM hardcore style its the heavy weight champion of s**ty RAM usage… NO DOUBT, 12GB should be the like
Enhanced amount over 8GB and this person is dealing with Android/HTML yet that’s not enough? I deal with Windows and Xbox I mean Yeah at first when I was having some
out of RAM issues I thought it was me but after doing some research on this its the Engine.

Come on quit sucking up to Epic they clearly cant make a Engine that deals with RAM well enough how about they redesign that hideous UI for starters its so outdated and
modernize it that will free up some RAM for sure and how about a blank level uses already 1GB even on a side scroller come on they need to optimize the Engine more.

Not a blind loyalist dude

“it can easily go up to 25 Gb if not used correctly.”
Come on… get out of here with that **** “C R A P”

Oh wow you really have some anger issues, really professional of you…
Do some research before you say something stupid.

You pretty much need at least 16GB to be able to use UE4. Sure some things work with less than that, but it won’t really be fun, especially if you use static lighting. Even when I had 32GB of RAM I often had that being completely filled while using UE4 + Chrome. Only when I upgraded to 48GB of RAM I no longer had issues with it, so 48GB seems to be “enough” for UE4.

I was being suggested 16GB of RAM and the fact you said it easily goes up to 25GB only proved my suspicion that
this engine constantly eats up RAM and buying more would had been a waste of money.

You call that Anger issues? cause I said “C r a p”? That only makes me question your masculinity.

Again completely ignoring what I said, here is a hint: Lightmass (think about it)

Than they can use Dynamic lighting instead sure its expensive but it wont bake anything.

Hi @John Alcatraz!

I’m currently deciding whether to go full dynamic lighting or offline lighting for my game.

I was under the impression that, UE4’s offline lighting solution/ bake lighting can be very time consuming but not memory consuming (compare to packaging).

48GB of RAM just for baking light…seems like an outrageous amount of memory to me, may I ask how large is your map and how many actors are there in the map? (and perhaps your lightmass importance volume setup?)

Thank you.

I don’t even use any baked lighting and I have never used that with UE4. I know that it does need “outrageous amounts” of memory though if your map is a bit bigger. It is just as memory consuming as time consuming. For example, the “Landscape Mountain Demo” takes 24GB of RAM to build lighting.

I am using dynamic lighting everywhere, and even with that I needed 48GB of RAM to be happy with UE4. Now to be honest, I always have something like 100 tabs in Chrome opened in the background, so that already consumes quite a bit of memory, its not all UE4. I guess something like 10GB is constantly filled with Chrome. UE4 often has more or less significant memory leaks though, so after using the editor for a while that can significantly increase memory cost.

And then I’m also using C++ and my own code sometimes has memory leaks, and its just annoying to have UE4 crash within a few seconds or minutes just because the RAM is filled. Its a lot nicer to work on stuff when not every more or less small issue in your code makes UE4 quickly run out of memory.

Hi @John Alcatraz,

Am I correct to assume the main cause of the RAM problem comes from UE4 code / editor memory leaks?

(as for chrome being memory hungry, I use “The Great Suspender” to remedy the problem, it saves about 30% of my RAM, you could try it out!)

I’m currently leaning toward using fully dynamic light in my game. Besides fast iteration and less setup work (ex: creating extra uv channel for all the meshes…), is there any other particular reasons that lead you to use dynamic lighting?

Thanks again for the fast reply.

Well, partly. The Kite Demo for example does not use any static lighting, but just for opening the project you need at least 32GB RAM I think. Because the project loads so many 4K or 8K textures that the RAM is just filled with that. So if you have many high res textures in your project, it will use a lot of RAM.

That likely means “killing” tabs in the background so that when you open it, it takes a while before you can see it. That’s inconvenient.

In my game everything has to be dynamic, I don’t have any static objects. So its just impossible to use static lighting. If most of the objects in the game are static, then baked lighting is the better solution due to looking better and being cheaper to render.