Unity Tips – Memory Profiler

Unity has a very helpful tool availability within it’s Package Manager for analysing memory usage known as the ‘Memory Profiler’. This tool is very helpful to optimise your game as it allows you to see what is currently loaded into memory at a given moment in time.

The Memory Profiler will show you in chunks what is being used at an overview, and you can click on these overviews to see exactly what assets are being loaded to contribute to that. See my very creatively named “RawImage_File” in the “Texture2D” section in the image below.

At the time of writing, the Memory Profiler is currently in preview, so in order to import the Memory Profiler into your project, you will need to bring it in from the Package Manager. You will need to ‘Show preview packages’ to be able to find it. Even though it’s in preview, it’s still very helpful, so don’t dismiss it even if you come across a few stability issues (which is likely).

Make preview packages available by clicking ‘Show preview packages’ in the ‘Advanced’ menu.

You can open the Memory Profiler from “Window > Analysis > Memory Profiler”. Once open you can take a snapshot of the current memory state by hitting “Capture Player”. You can then open this snapshot up to see it by pressing the open button in the newly created list entry.

You can also load two memory snapshots at once in order to compare them easier. Though this package is still in preview at the moment (and will be for a while i’m guessing), it’s a very helpful tool and is definitely worth checking out.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s