[FMemory Allocation] How Much System Memory Does a UE4 Game Instance Set Aside For Itself?

Dear Friends at Epic,

This is not an existing crash but I am anticipating how to avoid one.

I am using FMemory::Malloc and FMemory::Free for my dynamic memory allocation needs.

I had to use these for my undo/redo feature that uses struct inheritance and FORCEINLINE functions,

so I had to declare the right amount of space for each type of USTRUCT pointer in the context of an inline function.

#How Much Memory Does UE4 Game Instance Set Aside?

How much system memory does a UE4 game instance set aside for itself? (Editor is not loaded, this is not PIE, just independent game instance like the end user will have)

#Avoiding a Crash

The average dynamic memory allocation per undo event for my game is about 200 bytes

How many undo/redo events do you think I can store before the game instance would run out of allowed memory usage?


I know this question is broad and I am not expecting an exact answer of any kind,

I’m just trying to get perspective on whether I need to limit my undo feature to a max number of entries and what that max would be

I’d prefer to keep it unlimited :slight_smile:



I believe this to be a Windows orientated issue.

In a 32 bit version of Windows, UE4 will be able to allocate a maximum of 3GB assuming it is large address aware (I’m not sure that it is, and if not it will support only 2GB). Ina 64-bit version of Windows, your mileage may vary. Windows 7 Home Basic will allow up to 8GB of memory, but Windows 8 Enterprise supports 512GB.

Either way, 200 bytes is pretty small. You could have hundreds of thousands of undo operations with very little memory overhead?

“Ina 64-bit version of Windows, your mileage may vary. Windows 7 Home Basic will allow up to 8GB of memory”

This is the info I am interested in :slight_smile:

If the limit is anywhere near anything like this then I am happy :slight_smile:

Yea I dont think the user is like to reach the undo/redo dynamic mem limit hee hee

Thanks Luke!