Does using a UINTERFACE add an additional UObject to the class instantiation?

Might be a long shot to get an answer to this but hopefully someone can help:

Does anyone know if UINTERFACES are implemented by adding 1 additional UObject to the base UObject at instantiation? Or do they work more in line with regular C++ inheritance(multi-inheritance).

To summarize the question in case I’m not clear:

A scene with 10,000 UMyObjects which are 1UObject each. If I added 4 UInterfaces to my UMyObject would that increase the scene up to 50,000 UObjects?

Along this line does anyone know if usage of UPROPERTY() or other specifiers increase UObject count in anyway? I’ve seen reports that using a BpMacro in blueprint graphs can blow up UObject count as well.

I started becoming more concerned about this reading an article by epic which stated to avoid using the widget sequencer anim track for things like damage text because each anim requires a UObject instantiation, with rapidly spawning widgets it would strain the system to much. Damage text doesn’t seem so rapid fire that it should cause issues, so I was a bit shocked. I ran some tests on UObjects to see with some mass spawning / destruction. I did get meaningful consequences from tests that were not even that extreme specifically when destroying many UObjects. As a result I’m trying to discover and evaluate anywhere I’m not aware of, that might be generating UObjects.

Thank you for your time!

UInterfaces and UProperties add an object within the class definitions (UClass), but not to its instantiations.

The UPROPERTY specifiers “Instanced” / “EditInlineNew” would generate an additional UObject at instanciation, but that’s kinda the whole point of those specifiers.

1 Like

@Chatouille is correct.

I also want to add that you can use the console command obj list to list every single UObject currently alive grouped by their class, and then obj list class=x where class is the class name from the previous command, and will display every single object of that class, its full name and memory.

1 Like