Page 1 of 1

[1.0.0] Memory Leak

Posted: Thu Oct 15, 2020 12:52 pm
by crazypie
Memory leak when creating lots of bitters by script. Memory usage does not drop even if all of the bitters are killed.

How to reproduce?
Surround the origin point of the map with flamethrowers to kill bitters. Then run this code to generate bitters at origin.

Code: Select all

script.on_event(defines.events.on_tick, function(event)
    for _ = 1, 10 do
        game.surfaces["nauvis"].create_entity({name="small-biter", position={0, 0}})
    end
end)
The game will be laggy, so after some time remove the event handler and remove all entities on the map. But memory usage still stays high after clearing all the entities, unless you save the game and reload it.

Re: [1.0.0] Memory Leak

Posted: Thu Oct 15, 2020 1:21 pm
by boskid
Cannot reproduce any leaks. There are multiple biters spawned at at {0,0} not moving and colliding with each other and every time i removed all of them (using entity editor with fastest spray) memory usage was back to normal (aka dropped by almost nothing). Game becoming laggy by having a lot of biters colliding with each other is nothing interesting to be called a "bug" (other than pile of bugs).

When using flamethrowers there were a lot of biter corpses, maybe this is what you call "the leak" ? You can check amount of entities on the surface using

Code: Select all

/c game.print(#game.player.surface.find_entities())

Re: [1.0.0] Memory Leak

Posted: Fri Oct 16, 2020 9:35 am
by crazypie
Thank you. I did not notice that corpses occupied memory.