Thanks for looking into my fork-save report.
![Smile :)](./images/smilies/icon_e_smile.gif)
I'm not sure (yet) about Bwuhuo or Vulcanus, but everybody knows that Nauvis (like Earth) is flat, not a globeGergely wrote: Fri Apr 26, 2024 11:09 am Doesn't "global statistics" imply statistics over a globe, or in other words a planet?
From what I understand, that should/wouldn't/can't actually help. The "fork" syscall is extremely efficient, and uses copy-on-write to avoid duplicating things it doesn't have to. So if it's not actually used, it shouldn't actually use extra RAM anyway. While it MAY be possible for the forked instance to "free" things that it knows that 1. it doesn't need. 2. the original will modify and 3. are large enough to make a difference, it's unlikely that such an effort would yield useful results. And may actually cause problems.Greaka wrote: Fri Apr 26, 2024 12:46 pm I don't know if you can take anything away from this, I just wanted to share a user story after you asked for feedback. If it's possible, it might be worth exploring if the forked Factorio instance could unload essentially everything but raw entity data or similar. I don't know much about the internals of the game, even after reading all FFFs.
Yes!! Please make pollution_statistics production by force and surface!So what do you think? Are there any other statistics improvements you can think about for 2.0?
Definitely agree with this. Right now the power grid statistics don't distinguish between "at capacity" (or, because of rounding, near capacity) and "over capacity" at all; it's only visible by looking for spots where your power distribution/generation is suspiciously flat for long stretches. Seeing the actual value of demand spikes that are higher than my supply would be very helpful when I'm trying to plan out how much more power I need.d3mi3n wrote: Fri Apr 26, 2024 12:05 pm Furthermore the game currently only provides power consumption vs productions. Power demand is completely missing from the game and imo that's the most important one to see how the power plant(s) are doing.
If the fork() finishes and the forked process checks if it is the child and not the parent, the forking already took place. The resources are already duplicated. There is no benefit in then releasing anything, just to release everything after the memory dump of the map finished anyway.Greaka wrote: Fri Apr 26, 2024 12:46 pmIf it's possible, it might be worth exploring if the forked Factorio instance could unload essentially everything but raw entity data or similar. I don't know much about the internals of the game, even after reading all FFFs.
I love to tinker with builds until the actual production matches the calculated maximum. It would be great to have output per second and/or more digits in the stats, both presumably through some setting.So what do you think? Are there any other statistics improvements you can think about for 2.0?
As far as I know, Factorio runs almost entirely in the memory, unlike most other games, which is why even slight issues with your ram are noticeable in Factorio while everything else seemingly runs just fine and you need so much more for this game as the factory grows. I imagine this is what contributes to the double ram usage, though note they were likely referring to the memory that Factorio was using for your running game, not everything else.jgilmore42 wrote: Fri Apr 26, 2024 1:43 pm I'll admit that I'm a bit puzzled by the claim that it takes twice as much memory though - most of that should be libraries, graphics, etc. that aren't going to be modified by EITHER process, and thus won't be duplicated no matter what either does.
It seems you're mixing some things up. What Factorio is sensitive to is RAM and cache access time. Not the amount. Most other games aren't optimized anywhere near as well for memory speed to matter a great deal.FuryoftheStars wrote: Fri Apr 26, 2024 2:33 pm As far as I know, Factorio runs almost entirely in the memory, unlike most other games, which is why even slight issues with your ram are noticeable in Factorio while everything else seemingly runs just fine and you need so much more for this game as the factory grows.
Personally my biggest request is to make the contents of the search bar sticky.Are there any other statistics improvements you can think about for 2.0?
No, I did not say the amount of ram consumed by Factorio has bearing on its sensitivity to ram issues. I said the fact that it runs almost entirely in the ram does. There's a difference.Serenity wrote: Fri Apr 26, 2024 2:46 pmIt seems you're mixing some things up. What Factorio is sensitive to is RAM and cache access time. Not the amount. Most other games aren't optimized anywhere near as well for memory speed to matter a great deal.FuryoftheStars wrote: Fri Apr 26, 2024 2:33 pm As far as I know, Factorio runs almost entirely in the memory, unlike most other games, which is why even slight issues with your ram are noticeable in Factorio while everything else seemingly runs just fine and you need so much more for this game as the factory grows.
Wanna join the Flat Nauvis Society?Gergely wrote: Fri Apr 26, 2024 11:09 am Doesn't "global statistics" imply statistics over a globe, or in other words a planet?
The memory cost is in that the memory in the saving fork is constant, while the main game process continues to simulate and may be changing all kinds of game data. While the save is running, many memory writes in the main game process incur the time and RAM overhead of a page copy.Tertius wrote: Fri Apr 26, 2024 2:13 pmIf the fork() finishes and the forked process checks if it is the child and not the parent, the forking already took place. The resources are already duplicated. There is no benefit in then releasing anything, just to release everything after the memory dump of the map finished anyway.Greaka wrote: Fri Apr 26, 2024 12:46 pmIf it's possible, it might be worth exploring if the forked Factorio instance could unload essentially everything but raw entity data or similar. I don't know much about the internals of the game, even after reading all FFFs.
The fork() system call doesn't really copy everything a process owns. On modern unix systems, it duplicates the small process table entry and some management data within the kernel, but process memory isn't physically duplicated. With virtual memory management, only single memory pages are copied on the fly into process private memory space if one of the processes writes something into their memory - it's copy on write. If the parent Factorio process that continues to run changes 5% of its process memory while the child is saving at the same time, only this 5% is actually copied by the kernel and allocated separately.