How to use Unreal4.27 program memory analysis tool

Why can’t I view the memory usage of my packaged program using UnrealInsights? I set the command line parameters according to the official website: MyProject.exe -trace=default,memory. I then used Trace.Start and Trace.Stop to record data while the project was running, but when I open the saved data in UnrealInsights.exe, I can’t select MemoryInsights.

1 Like

Hi @qiuter ,
I did some research and found these post, maybe it will be useful.

I’ll also leave you the documentation in case you want to know a little more about Unreal Insights

I hope one of these solutions works for you.

2 Likes

Yes, I’ve read the official documentation, but it only covers how to use the MemoryInsights tool for Unreal Engine 5 and later. There’s no tutorial for Unreal Engine 4.27. I’d like to know if MemoryInsights can be used with Unreal Engine 4.27. If so, what are the startup parameters?

Unreal Engine 5.6 has been tested and works, but Unreal Engine 4.27 doesn’t:

The following is the official demo video of Unreal 4.27. The MemoryInsights tool can also be used in the video, but the startup parameters are not given.

I found the startup parameters for MemoryInsights (asked the Mrs.Unreal bot on the Unreal server on Discord)

Response to <@1098054630279217264> Discord PostID: 19586 | <t:1755586067:R> <:discordbot:1173315485786447922> | View your AI History | View all AI users

Hello there, ma__am! Mrs Unreal here in the 🌱beginners-help🌱 channel, ready to help you navigate the tricky waters of older Unreal Engine versions and missing documentation!

You’re absolutely right; finding specific MemoryInsights information for Unreal Engine 4.27 can be a bit of a challenge, as Epic Games definitely put a lot more focus on it for UE5. However, MemoryInsights (as part of the broader Insights tool) was indeed functional and available in UE4.27!

The core idea is to launch your game with specific -trace command-line parameters to tell the engine what data to record, and then use the UnrealInsights.exe viewer to analyze it.

Startup Parameters for MemoryInsights in Unreal Engine 4.27:

To record memory data, you’ll primarily need the memory trace channel. It’s also a good idea to include cpu and gpu for broader context, as memory usage often correlates with CPU/GPU activity.

Here are the most common and useful parameters:

  • For Profiling a Development Build of Your Game (Recommended):
    YourGame.exe -trace=cpu,gpu,memory,bookmarks -tracefile=MyMemoryTrace.utrace -statunit -log
    
    • Replace YourGame.exe with the actual name of your game’s executable (found in YourProject\WindowsNoEditor\YourGame\Binaries\Win64).
    • -trace=cpu,gpu,memory,bookmarks: These are the trace channels.
      • cpu: Records CPU activity.
      • gpu: Records GPU activity.
      • memory: Crucial for MemoryInsights! Records memory allocations and deallocations.
      • bookmarks: Allows you to add custom markers in your trace from Blueprints or C

Well, I’ve been trying this in my engine and managed to get it working.
First, I went to Package Project → Windows (64-bit) to cook the project. There you need to pick the output path; I set mine to:

MyProject (your current project)\Binaries\Win64

After that, you’ll get an .exe along with some extra files.

In that folder, hold Shift and right-click on an empty space. and choose “Open PowerShell window here” or “Open Command window here”. You should see something like:

Projects\MyProject\Binaries\Win64>

Then run:

.\(your project name).exe -trace="cpu,gpu,memory,bookmarks" -tracehost=127.0.0.1
(i dont try with this but i think it should work "YourGame.exe -trace=cpu,gpu,memory,bookmarks -tracefile=MyMemoryTrace.utrace -statunit -log ")

and hit enter.

From there you can use the trace.start and trace.stop commands, and in the Unreal Insights folder you should see the Memory Insights option appear.

As a side note, in the editor go to Window → Developer Tools → Session Frontend (in UE 4.27 it still doesn’t show up as “Unreal Insights” from what I’ve seen).

Let me know if it worked for you.

1 Like

Thank you very much for your answer. This startup parameter is available and can monitor the memory usage of the packaging program in real time :+1: :folded_hands:

1 Like