iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🪄

[UE5] How to Use Memory Insights and Display Asset Usage

に公開

Environment at the Time of Writing

Item Version
Unreal Engine 5.6.1
OS Windows 11
Platform Windows

Overview

Using UnrealInsights for performance measurement in Unreal Engine is convenient.
While CPU and GPU aspects are often discussed, this time I would like to touch on how to use MemoryInsights.
Specifically, I finally figured out how to display the memory breakdown of assets used in a scene, so I want to share that.

How to Use

To use MemoryInsights, you need to provide a command-line argument at launch.
If you only use MemoryInsights, set the following parameters and execute:

-tracefile -trace=default,memory

After execution, a .utrace file will be generated in the Saved/Profiling/ folder.
Load this .utrace file into the SessionFrontend of UnrealInsights to check the trace results.
SessionFrontend can be launched from the bottom menu of the Editor.

When memory tracing is enabled, the MemoryInsights tab will appear when trace results are displayed, showing how much memory is consumed for each category.
It is also useful for leak detection.

However, with just this, you can see the memory consumption per category, but you cannot see "which assets" are consuming "how much" memory.
The figure below is an attempt to display the contents of the SkeletalMesh Tag.

To obtain asset information, you need to add the metadata,assetmetadata parameter.
Do it as follows:

-tracefile -trace=default,memory,metadata,assetmetadata

This will cause the information in the Investigation to include Asset and Package details, allowing you to categorize them.
You can see that the information inside SkeletalMesh, which was missing in the previous figure, is now visible.

By following this information, you should be able to grasp the details of assets with high memory consumption or those that are leaking.

References

Unreal Engine Memory Insights | Epic Developer Community
Performance Analysis and Optimization Mastery Using Unreal Insights | Docswell
[UE4] Memory Tracking Using Memory Insights | Qiita
Memory insights and tracing with callstacks for Android | Epic Developer Community

GitHubで編集を提案

Discussion