About garbage collector efficiency using local variables

if you go to content browser and go to the scene tab how many show in that? My biggest map is 2734 items in the scene. Where do you find the total amount of objects in the map? it looks like scene covers everything in my map but the player and weapons and menu stuff.

I think you are talking about actors, not objects (although actors are objects too).

I have 259 actors in the persistent level, and in the city stream level, about 1600 actors. In game, about 1200 NPCs are loaded. So they can be about 3100 actors loaded once.

But it seems that every actor has a lot of objects attached (skelmesh component, voices, LE, etc).

The engine blank map has about 115,000 objetcts, and there are only a floor, a cube, sky, lights, fogā€¦ and no much more.

I have searching for this problems and I found some UE3 games with the same issue, and some players talks about changing valours in the iniā€™s:

[Core.System]
MaxObjectsNotConsideredByGC
SizeOfPermanentObjectPool

But no changes in my case. Perhaps in the cooked game.

I have found this too:
TimeBetweenPurgingPendingKillObjects = 30

I have incremented to 120 and seems to work fine, the hitch is higher (from 50 ms to 62 ms) due more objects to purge, but happens every 2 minutes instead 30 secs. I think is a good deal.

Iā€™m going to increment to 600 to see what happens. I can do a GC manually for example when open the pause or inventory, or the player is idle.

First test:

[0902.62] DevGarbage: Collecting garbage
[0902.67] DevGarbage: 50.814915 ms for realtime GC
[0902.80] DevGarbage: 133.373119 ms for unhashing unreachable objects
[0903.70] DevGarbage: GC purged 261649 objects (591699 ā†’ 330050)

objects purged takes 133 ms, instead 3 or 4. The peak is higher, but itā€™s one time every 10 minutes. The game seems stable, also the RAM.
if there are no unexpected problems, it seems like a good solution.

we have those two set to 0

[Core.System]
MaxObjectsNotConsideredByGC=0
SizeOfPermanentObjectPool=0

and this at 60

TimeBetweenPurgingPendingKillObjects=60

The two firts parameters donā€™t affect nothing in my case, same objects to chech, same times, etc. I have to test them with a cooked game.

With time between purging iā€™m doing tests with a value of 600. Works fine, stable. The times are x3, about 150 ms every check instead 50, but every 10 minutes instead every 30 seconds. Perhaps a value of 300 is more reasonable.

The iteration time is the same, but the purge time is bigger because there are more objects acumulated to delete.

There are some forced GC by the engine, for example when a stream level is loaded.
I was wondering why the engine took so long to load a stream level even if it was very smallā€¦ I didnā€™t know that a GC was done before.

So, this is the bad part, more objects to purge when a stream level is loaded.

good to see you figured it out. Always nice to solve an irritating problem.

Thank you, I hope this works well, without surprises.