that’s my assumption too, but not sure how to test that?
I guess, load a handful of textures, then call the garbage collect node?
Just tried it, doesn’t work
It might work in standalone, but then I can’t look at the resource viewer…
Na… doesn’t work in standalone either
my solution is wrap the AsyncLoad in an object and then destroy the object
Update. I was wrong.
Try using load asset many times in a standalone game, and then use ‘memreport -full’.
Only assets that get assigned to something or actually used will take space.
I have a system where I swap sky textures as I move around the game. I always have 2 in use, because I need to be able to lerp between them.
EDIT: Only the two textures I’m using are loaded. ( I had a default texture in the material instance, which I removed ).
I originally had the Async in my Asset Manager SubSystem (Object) in the Event Graph, but couldn’t use it as it needed to have World Context (if I remember correctly, but either way, couldn’t)
How are you running it in an object and then deleting object? Did you put it in an actor or someting?
Could you elaborate on this for me? I et what your saying, but I don’t know enough of engine backend to know why this is to try and figure out a solution?
In this, you are telling me how I have this setup will not work and I will get bugs correct?
Is this because the reference to the current object loaded via Async Load will be lost when the next Async Load is executed before the first one is completed?
My thought process was this:
Call Async Load → Starts thread loading object
Call Async Load → Starts Second thread loading second object
AsyncLoad Completes → Calls Function Passing Object Reference to Function (The function then simply saves the object reference to a map variable on the object containing the function)
2nd AsyncLoad Completes → same as above
From what your saying, I am understanding this?:
Call AsyncLoad → Starts Loading Object
Call AsyncLoad → Starts Loading Object, but overwrites the previous AsyncLoad fi it has not completed?
How do I have my Game Instance do this at a specific time?
Like, what if I create a blutility to create 1000 Data Assets (or more?) in editor, then run a standalone game that AsyncLoads the 1000 Assets and runs the ‘memreport -full’. to try and test?
i created my own c++ UObject, with world context and destroyobject functionality,
im not sure if you can in the base UObject but can try and set the ref to null
correct, calling the AsyncLoad creates a separate instance BUT you only have one (the latest i assume) Object output pin, so when you call Ininialize it’ll only work on the latest instance.
Also since you’re pulling the bDebug off the EventNode, if the event has changed it’ll potentially have the wrong value. ( to test this easily, you could Aync spawn actors of class, pass in different vectors and you’ll see they all spawn at the latest vector)
where this may accidentally work is if you’re loading the same object it’ll complete instantly if its already loaded
I just made it a keyboard event. That way, I can say when I want to load / unload / list memory etc.
Ah, I would if I could, but i do not know of a way to do this blueprint only. I like having the low (or is it high?) level object for doing operations that dont require a visual representation etc., but would seem essential to have the ability to destroy anything created no?
I am glad that I can fallback to soft references, but from what I am getting from what you both have been showing is that only one instance of the output, but what about that Event Initialize that it is calling, that it is on a different object? The Main SubSystem Calls Initialize on Each SubSystem, and each SubSystem is a different object. So, would that then pass that keep that object in a different location i nmeory, and the Async would overwrite its output pin, but not the object stored now on the other object? Or would they both always be in memory since the SubSystem has a reference to the GameInstance, and the Game Instance has a Reference to the SuSystem?..or, would it still get over written because of the soft references?
If you were loading objects, and then assigning them to something in another blueprint, then they would stay loaded.
Try the memory dump thing, very illuminating
This is what I have so far, but unsure how to test memory to make sure it is all working correctly, as it seems as it is now, to be working correctly.
Code that runs when Initialize Button is Pressed for Asset Manager

Initialize is called on the SubSystem Asset Manager
Asset Manager calls Initialize Character Assets Event
This then Calls Async Load Character Assets on the Game Instance
When the Async Load is COmplete, it calls the Initialize CharacterAsset Event on the SubSystem Asset Manager
This then Calls Add Character Asset on theSubSystem Asset Manager
Which then calls the Add Character Asset event on the SubSytems Panel Widget
Seems to work, but again, don’t see anything with memory changing (stat.memory), is there a better way (memreport -full didn’t do anything? Does it save to a txt file output?)
Here is a video
I ended up having the event call another event on the object it loaded, so that object could then “initialize” itself and tell the proper subsystem it was created and this way each class can also have its own function for handling the event
Wanted to mark this solved and didnt really know who to give credit too, but this was the most base solution to the actual question, but I certainly hope devs that come across this will read through to get a better understanding of controlling memory better in blueprint only projects
P.S. - A Note To Others Finding Their Way Here
For my Async Events, I moved them to my GameMode for these reasons:
- Hopefully prevent output pins from always staying in memory, as I believe switching levels will clear the GameMode
- I can have code migrated to other projects more easily by using GM than GI
- I am hoping (don’t know for sure?) using GM will give better/easier support down the road for Mods?
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.