Packaging my game eat up almost 80% of my RAM. What will happen if it reaches 100%?

Hi, I’ve been constantly packagaing (shipping) my game to try out and see if everything is ok with shipping build. So far so good.

However, I am concerned about the memory usage while packaging my game.

I got 8GB of ram and packaging almost use up to 8x% percent of it, I didn’t noticed it until recently as my project become larger and larger.

I also noticed if I unchecked combine all asset into one .pak file, the memory usage will decrease greatly, however, I really wish my game can have a single .pak file (for easy distribution)

Anyone encounter this problem before? How do you decrease memory usage while packaging? Is it even a problem at all? Will UE4 editor crash if it reaches 100%?


Once your RAM usage reaches 100%, it will either crash, or weird things might start happening. I believe the reason that not combining them into 1 file reduces RAM usage is that it probably packages one PAK file at a time, which is less RAM being used all at once. This sort of RAM usage does not seem very unusual, as 8GB of RAM is pretty much the min requirement for running UE4.

I see.

Thank you for the quick response.

I think I will just unchecked build .pak file option.

It could crash, but I’d expect it’ll probably keep running when you reach the limit, but your machine will slow down significantly.

I reach almost 100% of RAM all the time :slight_smile: …the key is setting your swap file (virtual RAM) large enough on your hard disk. So if you only have 8GB, have 8-16GB worth of swap. If you have an SSD when it starts hitting the swap it is not too bad but with a regular 5400rpm drive things can get very slow.

You can change the swap file settings by doing this:

For me I have the swap file only on my SSD drive, and I have 16GB of physical RAM and I set the swap file to 20GB.

It may sound insane but with an SSD this means you can do lots of stuff without worrying about Windows and apps crashing because they run out of RAM.

Swap file space doesn’t mean once it fills up your physical RAM it will use the virtual RAM exclusively, AFAIK it will try and cleverly prioritise what apps/processes use the physical RAM and what is “swapped” in and out of virtual RAM.

Hope this helps.

Hey, thank you for the detailed explanation.

Sadly I don’t have a SSD drive, my regular hard drive have enough space for swap, but I think I’ll just avoid packaging with one .pak file…for now.

Also, I’m curious how big is your project file? Over 100% with 16GB while packaging just seems…really really big?

Is UE4 suppose to eat up so much RAM while packaging?

For reference, My project file is about 7.5GB and my shipped game is about 1.85GB, how come it needs more than 1.85GB to pack my game?

Apologize if this is a dumb question, but I’m not really good at those tech things, I just need to make sure I’m not packing my game the wrong way.

Thank you again.

2015/10/07 edit:

I think I made a silly mistake while calculating the RAM usage by UE4. I overlooked the fact that UE4 editor itself also need memory while I’m packaging my game so:

UE4 editor: 5.5 GB
Packed Game: 1.85 GB

which almost make up to 8x%~9x% of my 8GB RAM.

So, I guess my question should be, is there a way to package game without editor running in the background? Like UDK’s UnrealFrontEnd??

SSD = Solid State Drive
No offense intended

You’ll need to fix that. 512 GB drives are $175; 1 TB drives are $340.
This is easily the best bang-for-the-buck upgrade you can make to a laptop or desktop computer.

Separately: “used RAM” is not a 100% accurate measurement. Things like file buffers may or may not be counted, for example, and may be shared by multiple processes. The OS may also be able to evict memory pages without having to write them to disk when memory gets full (for shared libraries and such) which also makes the measurement somewhat squishy.
But, if you find that a package suddenly takes a lot longer, you likely started paging to disk, which is better than crashing but not a productive way to spend your life long term.

Good point. I’m so used to saying SSD drive and HD drive or even HDD drive!

It’s usually because I am doing Lightmass lightmapping, have 2 UE4 projects open, and several other apps too. :slight_smile:

OK, that part I’m not sure. But to be honest even with a hard disk only and not SSD, I would suggest, in the short term, set your swap file to 16GB, and not to worry too much about the memory being used. If you can successfully create the .pak and things are not too slow, then I think that seems to be most important.

Of course, in the long term, optimising RAM usage when using Unreal is worthwhile too, I’ll leave others to advise.

All the best.

I have a similar problem When I start packing, my RAM drops to 100% Please help me؟؟