Clear memory

Is there a command for clearing the memory or something?

If you are doing C++ programming, then where ever you have malloced you need to dellete it (free it, drop it) when you don’t need it anymore. C++ is not a high level programming language (many may rage me xD) thus it has no garbage collector.

UE4 got garbage collection on all UObjects, it automatically removed objects from memory overtime when they not referenced anywhere anymore, thats why you should watch out on cycle referencing. Destroyed actors are removed automatically.

Generally you should not care much about it UE4 is designed to take care of memory for you, you can only help it by following UE4 conventions and don’t do useless things

1 Like

I am using blueprints…

Then you should take a look at Shadowrivers answer.