Memreport shows lot of objects not used in the current level


I did a memreport -full command to see how much memory stuff in my level uses at event begin play. Then I saw for the first time that a lot of stuff uses memory which even isn’t in the first level loaded.

Like for example a background music which isn’t playing in this level shows up with

                     Object               NumKBytes  MaxKBytes  ResKBytes ExclusiveResKBytes

SoundWave /Game/Audio/Music.Music 0K 0K 2922K 2922K

Then with obj refs name it gives me the following:

(standalone) SoundCue /Game/Audio/SC/Music_Cue.Music_Cue->AllNodes
LogReferenceChain: SoundNodeWavePlayer /Game/Audio/SC/Music_Cue.Music_Cue:SoundNodeWavePlayer_0->SoundWave
LogReferenceChain: (target) SoundWave /Game/Audio/Music.Music

And there are many objects showing up, even they are not needed in this level. Like for example also AI characters not used in this level at all.

Do I need to change some settings or is this like its suposed to be? Or is there maybe some stuff in c++ I can change so that in this example sound cues from other levels don’t use memory in other levels?

Thanks for an answer.

Edit: I found out that other things like skeletons are loading in because theirs assets are referenced by the default properties of their native class. Any guidance on what to do there?

(standalone) Blueprint /Game/AI2/botChar2.botChar2->GeneratedClass
LogReferenceChain: BlueprintGeneratedClass /Game/AI2/botChar2.botChar2_C->UE4Editor-CoreUObject.dll!UnknownFunction (0x00007ffb68a10240) + 0 bytes [UnknownFile:0]
LogReferenceChain: botChar2_C /Game/AI2/botChar2.Default__botChar2_C->Mesh
LogReferenceChain: SkeletalMeshComponent /Game/AI2/botChar2.Default__botChar2_C:CharacterMesh0->SkeletalMesh
LogReferenceChain: (target) SkeletalMesh /Game/AI2/Uiii/uiii.uiii

somebody has some experience with this?


If you somehow add a reference to the botChar2, all assets references by the BP will be loaded.
References can be added in native code, via BP, in the ini or by adding instances to the level.
‘Reference Viewer’ is the best way to see the references in the editor.
‘obj refs’ in the runtime.

This may differ between the editor and the game, the editor usually loads much more content than needed.

I’m not sure I answered your questions :), so let me know if you need more guidance.

I would recommend using async loading and hold the number of native referenced assets as low as possible.

Thanks for answers. I will check it out again.

Well for staying at one example: The sound cue is absolutely not used or referenced in anyway in the level I made the obj refs console command. But its true that I made those logs from editor play sessions. I will try to get some ingame logs from android where I deploy at the moment.

I wil also have a look at async loading, thanks for that!