# How do you debug if an asset is in memory during gameplay?

**URL:** <https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [October 23, 2021, 1:43pm UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291 "2021-10-23T13:43:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [October 23, 2021, 1:43pm UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291/1 "2021-10-23T13:43:46Z")

</div>

Hi! I am trying to understand the soft references usage, data assets, etc.  
I saw a couple youtube tut vids. and cmd command Obj list class= someclass will show a list of objects of that class in memory. the thing is that is showing me all that is in the editor folders already during gameplay…does that means everything in the editor is in the memory already even if I am not calling it from my objects?

1. I type this:

```auto
Obj list class=texture

```

it gives a long list of default editor assets like this:

```auto

                                                                                                                                      Object NumKB MaxKB ResExcKB ResExcDedSysKB ResExcShrSysKB ResExcDedVidKB ResExcShrVidKB ResExcUnkKB
                                                                              Texture2D /Engine/EditorResources/LightIcons/SkyLight.SkyLight 1.02 1.03 256.00 0.00 0.00 256.00 0.00 0.00
                                                       Texture2D /Engine/EngineMaterials/T_Default_Material_Grid_M.T_Default_Material_Grid_M 1.00 1.02 341.36 0.00 0.00 341.36 0.00 0.00
                                                       Texture2D /Engine/EngineMaterials/T_Default_Material_Grid_N.T_Default_Material_Grid_N 1.00 1.02 85.36 0.00 0.00 85.36 0.00 0.00
                                                              Texture2D /Engine/EditorResources/LightIcons/S_LightPointMove.S_LightPointMove 0.98 1.00 256.00 0.00 0.00 256.00 0.00 0.00
                                                                Texture2D /Paper2D/PlaceholderTextures/DummySpriteTexture.DummySpriteTexture 0.98 1.00 5.36 0.00 0.00 5.36 0.00 0.00
                                                                      Texture2D /Engine/EditorResources/LightIcons/S_LightError.S_LightError 0.98 1.00 256.00 0.00 0.00 256.00 0.00 0.00
                                                                Texture2D /Engine/EditorResources/LightIcons/S_LightSpotMove.S_LightSpotMove 0.98 1.00 256.00 0.00 0.00 256.00 0.00 0.00
                                                               Texture2D /Engine/EditorResources/S_TextRenderActorIcon.S_TextRenderActorIcon 0.98 0.99 5.36 0.00 0.00 5.36 0.00 0.00
                                                                           Texture2D /Engine/EditorResources/S_ReflActorIcon.S_ReflActorIcon 0.98 0.99 5.36 0.00 0.00 5.36 0.00 0.00
                                                                           Texture2D /Engine/EditorResources/S_ExpoHeightFog.S_ExpoHeightFog 0.97 0.99 21.33 0.00 0.00 21.33 0.00 0.00
                                                                       Texture2D /Engine/EditorResources/S_WindDirectional.S_WindDirectional 0.97 0.99 5.36 0.00 0.00 5.36 0.00 0.00
                                                                      Texture2D /Engine/EditorResources/LightIcons/S_LightPoint.S_LightPoint 0.97 0.98 256.00 0.00 0.00 256.00 0.00 0.00
                                               Texture2D /Engine/EditorMaterials/WidgetGridVertexColorMaterial.WidgetGridVertexColorMaterial 0.96 0.98 2.68 0.00 0.00 2.68 0.00 0.00
                                                                        Texture2D /Engine/EditorResources/LightIcons/S_LightSpot.S_LightSpot 0.96 0.98 256.00 0.00 0.00 256.00 0.00 0.00
                                                                                    Texture2D /Engine/EditorResources/AI/S_NavLink.S_NavLink 0.96 0.98 64.00 0.00 0.00 64.00 0.00 0.00
                                                                                     Texture2D /Engine/EditorResources/S_Thruster.S_Thruster 0.96 0.98 21.33 0.00 0.00 21.33 0.00 0.00
                                                                                       Texture2D /Engine/EditorResources/S_Emitter.S_Emitter 0.96 0.97 21.33 0.00 0.00 21.33 0.00 0.00
                                                                                       Texture2D /Engine/EditorResources/S_Terrain.S_Terrain 0.96 0.97 21.33   

.
.
.

```

even if I add some new textures in my editor folders and type that command, those new textures are listed too even If no object in the level is calling it.

can someone explain me this? all default EDITOR assets will live in memory even at runtime?  
why added assets to the editor resides in memory already even if I dont call em in any object?

thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4aa5607e1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4aa5607e1](https://forums.unrealengine.com/u/anonymous_user_4aa5607e1)\
**Post date:** [October 28, 2021, 11:45am UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291/2 "2021-10-28T11:45:32Z")

</div>

Everything you _open_ in the Editor is necessarily in-memory: the editor and game engine aren’t separate. So if you open a texture for editing, or open any other asset that references that texture (or asset that references an asset that references an asset that…), then it’ll get loaded. Assets that are closed and unreferenced by anything else will eventually be evicted from memory by the garbage collector.

The editor won’t load things till they’re needed, but there’s a ton of stuff that’ll get loaded through reference chains even when you’re just opening a level at startup. If you’ve only got soft refs to an asset, it won’t be loaded until someone tries to use it. But if anything else in the game/editor has a hard reference to it, it’ll get loaded anyway.

Creating a new asset involves generating it in memory, then (optionally) writing it to disc. So it’s not surprising new textures would be in memory after you’ve created them. If you create and save a new texture, don’t reference it, and restart the editor, I think you’ll find the texture isn’t in memory.

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [October 28, 2021, 2:16pm UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291/3 "2021-10-28T14:16:50Z")

</div>

Hi! thanks for your reply and you’re totally right. But…is there some ‘FLUSH EDITOR MEMORY’ command or something like that to avoid restart the editor each time I want to check? Is just for testing what is actually loaded once I run the game. Because as you say…maybe some other asset is queryng some hard reference already and all my soft reference work is useless 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4aa5607e1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4aa5607e1](https://forums.unrealengine.com/u/anonymous_user_4aa5607e1)\
**Post date:** [November 1, 2021, 4:52pm UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291/4 "2021-11-01T16:52:19Z")

</div>

Your first stop should be the reference viewer in the editor (right-click the asset), which lets you see what’s statically referencing your asset. You can increase “depth” to see further along the chain in either direction.

To see what’s referencing an asset _right now_ (i.e. hard refs by objects that are in memory), run `obj refs name=Asset_Name`. If that comes back as “not currently reachable” then you’re good, the asset won’t be forcibly kept in memory in-game. Whether it does actually remain in memory is up to the engine.

You can run `obj gc` to force a GC pass, but in my experience it’s not very aggressive for loaded assets in the editor - they tend to stay loaded.

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [November 1, 2021, 9:50pm UTC](https://forums.unrealengine.com/t/how-do-you-debug-if-an-asset-is-in-memory-during-gameplay/257291/5 "2021-11-01T21:50:20Z")

</div>

thanks!! Very usefull info in a single post 🙂
