Garbage Collection
Posted: Thu Jun 21, 2012 7:19 am
I have been working on mods for awhile and a lot of them spawn intermediate temporary objects at high rates. One place that I am doing this is in the PostRender() function, so every rendered frame I create an iterator object to iterate over a set of other objects. This is common practice in environments that have garbage collection, which includes (?) Unreal Script.
The reason the question mark is after "includes" in my previous statement is because I have noticed that Unreal's memory usage under these conditions increases monotonically and linearly with my framerate. I am not surprised that it is rising linearly, but am surprised that it is monotonic. Does anyone know when the garbage collector actually kicks in? Is it only between map switches or are there internal limits to how big the allocated heap space can grow before invoking a GC pass?
It looks like I am going to have to stay away from such frequent allocations, which is a shame (I'd use free if I could) because it means opening access to variables I do not want to make non-private. I know that private is compile-time, but that's beside the point and beyond the scope of this inquiry.
The reason the question mark is after "includes" in my previous statement is because I have noticed that Unreal's memory usage under these conditions increases monotonically and linearly with my framerate. I am not surprised that it is rising linearly, but am surprised that it is monotonic. Does anyone know when the garbage collector actually kicks in? Is it only between map switches or are there internal limits to how big the allocated heap space can grow before invoking a GC pass?
It looks like I am going to have to stay away from such frequent allocations, which is a shame (I'd use free if I could) because it means opening access to variables I do not want to make non-private. I know that private is compile-time, but that's beside the point and beyond the scope of this inquiry.