Should I create a pool manager?

We’ve been researching UE4 for a little while now, and a question has arisen. How does Unreal4 handle garbage collection? Say I want to spawn a lot of actors (bullets or other projectiles for example). Are there any options for pooling said object so that the garbage collector doesn’t get filled to the brim?

No answer just bumping because I am curious as well.

I’m not sure about it, but as far as i remeber, there was a pooling system (even if not automatic, you had to use it) in the UDK, so i suppose there is even for ue4

Did a test.
Spawn 1000 simple physics object (actor with static mesh and simple box collision)
Disable them
Active them after some time

Results: for 1000 objects spawning took ~4ms, activation ~0.4ms (on my machine).

I know this is for 1000 actors, so the benefit woudn’t be as high as this might claim most of the time. Still it’s worth to consider this optimization for mobile devices depending on particular project needs.
Hope this helps a little;)

Activation/Deactivation code:


  TInlineComponentArray<UActorComponent*> Components;
  for (int32 CompIdx = 0; CompIdx<Components.Num(); CompIdx++)

Did testing on mobile device too (Galaxy Note 3 - Snapdragon 800). Test has been done with 20 actor instance.
Spawn: ~30000 cpu cycles
Activate instance: ~9000 cpu cycles

using stats.

DECLARE_DWORD_ACCUMULATOR_STAT(TEXT("TR_Init"), STAT_PoolInit, STATGROUP_Quick);  //declare int counter
    const uint32 BroadcastBeginTime = FPlatformTime::Cycles();  //mark start
    // ... code
    const uint32 BroadcastEndTime = FPlatformTime::Cycles(); //mark end
    SET_DWORD_STAT(STAT_PoolInit, BroadcastEndTime - BroadcastBeginTime); //set the counter

Then on device open console (4-finger tap) write “stat quick”. You should see the counter value. More info here: Engine\Source\Runtime\Core\Public\Stats\Stats.h

i’m curious, how did you measure the cpu cycles in android?

thanks for this!