[.14.21] Not all memory freed after find_ent_filtered

Bugs that are actually features.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

[.14.21] Not all memory freed after find_ent_filtered

Post by Nexela »

Not sure if a bug or just cache related so move accordingly

It seems some of the memory from find_entities_filtered is not cleaned up after freeing everything

On a map with 5,287,977 Decorations
checked by using collectgarbage("count")*1024

Lua memory before loop
136,055 Lua Mem before iterating entities -- This is Expected
for _, decoration in pairs(game.surfaces[1].find_entities_filtered{type="decorative"}) do end
4,366,265,239 (4GB) Lua Memory After looping decorations --This is expected at least until .15 :)
469,876,647 (.5GB) After forcing Garbage Collection collectgarbage("collect") -- Not expected should be lower?, Also will not go any lower no matter how much time passes.
Saving (which now takes longer) and reloading the map brings both the system memory and Lua memory back to same levels as when started.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14736
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [.14.21] Not all memory freed after find_ent_filtered

Post by Rseding91 »

It's expected. The memory gets fragmented when you do that many operations. I've looked at it myself and it's not leaking anything in the sense that something is allocated and not deallocated through our code.
If you want to get ahold of me I'm almost always on Discord.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [.14.21] Not all memory freed after find_ent_filtered

Post by Nexela »

Awesome, Thank you for the detailed reply!
Post Reply

Return to “Not a bug”