TArray not properly garbage collected?
I have the following code in my blueprint based on AActor.
In the first one I store all my instances and GC works fine. If I divide my instances into separate components that I've added to MeshComponents it seems I get no GC, and every new run with "New editor window" causes more memory usage and less fps.
Works: MeshComponent with 100.000 instances
Doesn't work: TArray of 100 MeshComponents with 1000 instances each.
To answer my own question.
The problem was that the array wasn't the only reference to the object once you spawn them since they are attached to the AActor.
I do this when I unload to remove the instances.
answered Apr 08 '17 at 08:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here