Memory hard references and soft references

so if i have a class in the editor ( has no objects ) that is defined ( i created it ) , then in another blueprint i soft referenced the class , and for example i load it to memory after 20 seconds ,

my question is will the class be loaded in memory immediately ( since i have the class in the editor )
or will it wait 20 seconds then it will be loaded to memory?

If you have open the asset bp class from the content browser, then the completed node pin will be quicker since it already in the memory.

The time it will take otherwise will be ssd+cpu access time which are few mili seconds.

image

For the 20s i guess is just a delay and will depend on GC whether will be removed it from memory or not during that moment. GC trigger every 60s, so it supposed to be memory after you have opened the asset.
Better to test it out to be sure with a simple Start Profiling Timer:

I meant the delay 20 seconds i made it ,
Because i wanna see if the class will be in the memory just because it exists in the editor files already or will it wait for that object to hard reference it after 20 seconds

It depend:

If that asset class is already placed/spawned on the level map, it will be in memory.

If that asset class has been opened before from content browser, it will be in memory(until it get removed by GC).

Otherwise if that asset havent been touched before or spawn, it won’t be in memory. But will be valid only after the 20s + Async Load Class (completed pin) exec time.

Ohh ok thanks but is there a way to check if its loaded in memory or not? I tried using “is valid class” but it always returns true even if i havent placed it in the map nor touched it

1 Like

Am using this one:

Mine return false when not loaded and true when loaded.

Weird, mine always true even if i just created that class and didnt do anything with

After creating the bp class, you need to restart the editor and also not viewing the path of that class in the content browser.

ahh i see , thanks again

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.