[1.0.0] Memory Leak

Bugs that are actually features.
crazypie
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Sep 28, 2019 7:15 am
Contact:

[1.0.0] Memory Leak

Post 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.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3463
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.0.0] Memory Leak

Post 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())
crazypie
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Sep 28, 2019 7:15 am
Contact:

Re: [1.0.0] Memory Leak

Post by crazypie »

Thank you. I did not notice that corpses occupied memory.
Post Reply

Return to “Not a bug”