Memory leak when left a long time.

Bugs that are actually features.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15900
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Memory leak when left a long time.

Post by Rseding91 »

taiiat wrote:ah, just the sort of thing i was looking for.

in V0.12.33, there's definitely some sort of Memory Leak.
it seems to be very, very minor if you just start a new game and watch memory. but the more things you do, the faster it seems to leak.
ending up as the fairly early new game i had started, where i have a pretty small factory and hadn't even left the start area yet - Factorio using just shy of 5gigs of Memory.

i figured it was one of the Mods - so i disabled all of them. loaded the same save, still leaking heavily.
i started a new game, placed down a bunch of miners, some belts, and some inserters doing various things, and then looked at memory for a bit. it was definitely leaking, with the random bits i'd placed with, it was leaking ~4KBytes per second.

however the real save before, had definitely been leaking much faster than that, as it had gotten just under 5gigs.
Image

i can upload the related Save, but it's kind've huge. i'm guessing because the map is explored out quite a ways.
hell, maybe that's related, hmm.

hah! i made another blank new game, and explored out a ways on the map. the more i have explored, the faster it seems to leak from what i'm seeing.
even getting close to leaking 1MByte per second with a completely blank map (nothing built) with everything explored from -2048 to +2048.
You use that word a lot but I don't think you know what it actually means. A memory leak implies there's memory allocated that the program no longer has any references to and will never release until the program terminates. If you load a large map and it uses a bunch of RAM - that's normal. When you quit that map back to the main menu and it releases all of the RAM it was using that's not a memory leak - that's just the map using RAM as it's mean to, to run.
If you want to get ahold of me I'm almost always on Discord.
User avatar
taiiat
Long Handed Inserter
Long Handed Inserter
Posts: 81
Joined: Sat Apr 02, 2016 8:39 pm
Contact:

Re: Memory leak when left a long time.

Post by taiiat »

Rseding91 wrote:You use that word a lot but I don't think you know what it actually means. A memory leak implies there's memory allocated that the program no longer has any references to and will never release until the program terminates. If you load a large map and it uses a bunch of RAM - that's normal. When you quit that map back to the main menu and it releases all of the RAM it was using that's not a memory leak - that's just the map using RAM as it's mean to, to run.
yeah, sure, it doesn't fit the definition. it's still continually using more Memory as i allow the game to sit there. very significant amounts.
https://u.pomf.is/lbesuq.webm

this wasn't present previously, 12.29 and 12.30 definitely weren't doing this.
if it had been, sessions playing with friends would have became unplayable, as the Host would have been using all of their System Memory over the course of the many hours of play at a time.


the only thing that accumulates data over the course of the entire game, are basic stat tracking like Electric grid(s) and Et Cetera.
i find it hard to believe that these such stats significantly increase Memory usage over a short period of time. the time shown there that i loaded the game, and the minimized it and went to do other stuff while waiting for the graph to collect data - was only ~20 minutes. that's ~11.2% increased Memory usage over the course of ~20 minutes.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15900
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Memory leak when left a long time.

Post by Rseding91 »

taiiat wrote:yeah, sure, it doesn't fit the definition. it's still continually using more Memory as i allow the game to sit there. very significant amounts.
https://u.pomf.is/lbesuq.webm

this wasn't present previously, 12.29 and 12.30 definitely weren't doing this.
if it had been, sessions playing with friends would have became unplayable, as the Host would have been using all of their System Memory over the course of the many hours of play at a time.
Yes, they did. I run the game for 6+ hours at a time with no memory "leaks". The game uses an appropriate amount of RAM for what map I'm running and releases it when I exit the map back to the main menu.

taiiat wrote:the only thing that accumulates data over the course of the entire game, are basic stat tracking like Electric grid(s) and Et Cetera.
i find it hard to believe that these such stats significantly increase Memory usage over a short period of time. the time shown there that i loaded the game, and the minimized it and went to do other stuff while waiting for the graph to collect data - was only ~20 minutes. that's ~11.2% increased Memory usage over the course of ~20 minutes.
You know absolutely *nothing* about how the internals of the game work and what uses memory over time. There's background chunk generation, biter path finding, train path finding, items getting put onto and taken off of belts, items accumulating in chests, chunks getting charted, production/usage stats, biters spawning, any mods you may have running collecting/using data and more.

Unless you can get the program to use up memory and not free it when exiting the map to the main menu there is no memory leak. Any memory allocated while running the map is simply what the game takes to run and if your computer can't handle that then you need more RAM.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”