CPU Cores, memory, Optimization, etc

Hello.
I am wondering how unreal engine exactly work.
Do exist any functions/comamnds to manipulate how allocate tasks to CPU Cores?
Is there any possiblity to operate with memory - for example to clean it with unnecessary objects in desirable moment to optimize your game/program? Or is it assigning automatically by engine?
Could anyone explain it a little bit?

Thank you for Your answer.

Can write a book about this but sadly the engine isn’t that well documented already.
Afaik Blueprints are single threaded and in c++ memory management is mostly handled by implementing classes as UObjects and declaring properties as UPROPERTY.
Official sources on c++ topics are rare.

*edit this might be useful:

Sometimes (but very rarely) you will want to run the garbage collector manually but normally this is an automated process. I noticed myself that UserWidgets can take up a lot of resources (see the Slate ProcessMouseMoveEvent for example) if you add and remove widgets rapidly (opening / closing menus) for which I sometimes want to run garbage collection manually to avoid bad performance.

There a no functions to assign CPU time, that’s done by the operating system.

For optimization and memory, a lot of that is done automatically by the engine, but it is also possible to do something about it when you have a problem. Optimization is a ‘whole thing’