Download

Always leaking memory?

As I was busy stress-testing a project I am working on, I discovered a small memory leak. After some investigation it turned out that spawning actors and deleting them for some reason slowly leaks memory. At first I was using my own class derived from actor, and blamed that class. To make sure my class was to blame, I created a new empty class derived from Actor, and used that to see if the leak would not appear, but it did! (we are talking about spawning and deleting 1000s of objects per second).

Still thinking this must be some problem with my code, I opened a new project and made a blueprint actor which simply spawns 1000 actors of type actor per tick and removes them immediately. This still causes the memory to fill up and slowly grinds the game to a halt… what am i missing here?

Thanks!

1 Like

I have the same problem when spawning/deleting actors. I’m yet to find a proper solution for that leak.

had the same problem back then in 2005 with wc3 B-)))) solution - pooling. ie you recycle used actors (units). it’s ofc kind a joke BUT if you won’t fix it yourself in the source and it’s very critical for you i would go for this solution because it works. but ofc you can hope what someone will fix this and post a patch etc, it’s the right way and it’s good what you reported this, but it may take long time before it get fixed.

[Mar '18]

[10h]

ok i see B-)

@ AnuraDev
Sadly for my problem I cant pool actors, mainly because there is another bug (with ray-tracing temporal accumulators) that does not let me re-use actors.