I’m recently doing some memory management for my project.
By following some tutorials I now understand the brief idea about soft reference and hard reference.
But I don’t think I fully understand how to implement it 100% in a project to make things working properly just yet.
A specific question is that:
Say I have actor A and actor B, actor A cost 200MB RAM and actor B cost 300MB RAM.
actor A has a tag pointing to actor B, actor B has a cast node back to actor A.
So my question is, when actor A is always loaded and actor B isn’t loaded, in this specific situation, is my memory usage on actors 500MB or 200MB?
Also how do Tags check reference, does a tag equal a casting?
Thing like this still get me confused and I can’t seem to get a solid answer to that by monitoring my size map of my actor BPs.
Would like to use some help.
Thanks in advance!
You can test these with Size Map and Reference Viewer.
here some example:
I have 2 bp
Size Map of both(initial):
Size Map after adding Class Tag :
As you can see by the time you add a class(purple pin) hard reference, this will be loaded into the memory. Same goes in Reference Viewer.
If you use this one:
Since there no direct hard ref, it won’t load ActorB.
Thanks very much for the demonstration!
Yeah so as long as I don’t specify the class, it won’t be loaded…
This is what I was expecting. I was doing the similar thing with tags to get better memory usage out of my project but for whatever reason it just wouldn’t work. Until I packaged my project and then unpacked again into a clean slate, now everything I did worked all of sudden… I now see I’ve successfully reduced my main character’s memory usage to 1/3 of the original one. But it didn’t show up if I continue working with the old project folder.
Any explaination to something like this? Something got reset when I’m starting from a clean project? What could be stuck?
Show up in Size Map you mean ?
Let say you just open your project and you havent yet open/spawn/placed your character bp.
It size map (memory) won’t be loaded until you open the bp or spawned/placed it on the level map.
Yes it’s the BPs in size map, I noticed that without changing anything, after I opened up my previously worked maps/BPs the size map has been reduced, when I open a new clean backed up build.
It possible the shader cache inside the folder Intermediate/DerivedCache got reset when you have packaged it.
Ok thanks for the explaination, I guess cleaning the intermediate and cache folders every now and then might be a good habit then.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.