[Solved] Summary of Multiplayer-Related Memory Issues and Questions

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Xeon257
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

[Solved] Summary of Multiplayer-Related Memory Issues and Questions

Post by Xeon257 »

I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.

Hello, I’m having an issue while running a multiplayer server and would like to ask a question.
The main issues are periodic freezing and memory leaks.

First, our server hardware specifications are as follows:

CPU: AMD Ryzen 9 7950X
RAM: 24GB
SSD: 512GB
OS : Ubuntu 24.04.3 LTS
SaveFile : Version 2.0.69 70MB

The server is running Factorio version 2.0.69 Linux headless.

Asynchronous saving is enabled, the save interval is set to 1 minute, and we manage around 3,000 save files.

The server is based on the Enable All Planet Mod Pack and has around 200 mods in total.
(I am aware that there are a lot of mods, and I am working on reducing them.)

I am running the server using a program called Factorio Server Manager. (https://github.com/OpenFactorioServerMa ... er-manager)

To reduce the save file size, I have been regularly cleaning up the chunks of all planets. (https://mods.factorio.com/mod/Delete-Chunk-Tool)

I have been updating the mods frequently, checking for the latest versions and applying updates approximately every two days.

I am not very skilled at debugging Factorio. I can only understand basic information like time-usage.



1. The server has been running for about a month, and since there are many mods and it has been operating for a while, I’ve noticed that htop shows dozens of Factorio-related processes. Is this normal?

2. The Enable All Planet Mod Pack includes the Tiber planet mod. Recently, this mod has been causing severe delays of around 2,000 ms at intervals roughly similar to the autosave cycle (although I’m not certain if it happens exactly during autosave). I have contacted the mod author but have not found a solution yet. I could remove this mod, but that would delete the entire Tiber planet, so I would like to resolve the issue if possible. I’m also curious if other players have experienced similar problems. The tick issue on the Tiber planet does not seem to occur in singleplay.

3. The base memory usage of Factorio seems extremely high. When the server starts, it occupies around 19GB of RAM right away — is this normal?

4. The memory leak issue wasn’t very noticeable when the server first started, but over time the accumulated usage keeps increasing. Because of this, we currently have to reboot the server every 2–3 hours. Is this a common problem? Could it possibly be caused by one of the mods?

5. As the server runs, memory usage keeps increasing, and after several hours, it eventually stops due to running out of memory. At that point, it seems that more than 100 suspended Factorio processes have accumulated. When I issue a shutdown command to the server via RCON or similar tools, all these processes start shutting down sequentially, and it takes several minutes for everything to finish — during which all the pending autosaves also complete.

6. There is one notable point. I’m not sure if it’s just me, but when running this save file in single-player, exiting the game seems unusually slow, taking about 5–10 seconds.



I have resolved many issues while running the server so far, but this problem seems to be beyond my ability to fix. If I cannot solve it, I may have to shut down the server. Could you help me address this issue?
Last edited by Xeon257 on Fri Oct 10, 2025 1:03 am, edited 4 times in total.
robot256
Smart Inserter
Smart Inserter
Posts: 1293
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by robot256 »

Asynchronous saving is an experimental feature and has remained that way for years because of how many instability issues it can cause. The best thing for you to try first is to disable asynchronous saving and set the autoaave interval to 5 or 15 minutes. Then see what the memory usage looks like.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Xeon257
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Xeon257 »

Ah… I will try increasing the autosave interval to 5 minutes and see how it goes. Thank you.
Tertius
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Tertius »

The asynchronous save works by forking the factorio process and perform the save from the forked process with a frozen map while the primary process continues to serve the players with a live map. The forked process terminates after the save has been completed.

Forking is copy-on-write for memory, so first the forked process doesn't occupy real memory first. But the longer the forked process is alive the more map data is changed, so the more memory is occupied.

So it's crucial to have enough memory for the map data in the first place and in addition enough memory for changed map data accumulating while doing the save. And it's absolutely crucial to to make sure saving one autosave doesn't take more time than the autosave interval, otherwise forked processes will accumulate and not finish saving, and each will grow its memory usage until it is as big as the primary process.

About 19 Gig after starting the server: is this with a loaded save or without? If it's just a started server without any save, it's much too much. With a loaded save, it's probably ok if you have a very large map.
Xeon257
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Xeon257 »

Thank you for your response. However, if what you say is correct, that would mean autosaving takes more than a minute, and I’m not sure the process should actually take that long. Could there be something causing the save to take so much time?

The memory usage is around 20GB right from the start. The initial memory usage seems related to the current RAM capacity, but it starts by occupying almost 95% of it.
Tertius
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Tertius »

I cannot tell how long an autosave will take for your server. This is something you need to find out yourself. Factorio will first create a temporary directory and begin writing data to it, then it will zip it into the one save file. Monitor the directory and measure the time from the first appearance of the temporary map data until the zip is finished and the temporary data vanished.

But your server has only 24 GB memory. This is almost occupied by your one live Factorio instance. If there is some event that extends the saving, and more forked processes start to appear, the server might start swapping memory to disk, which completely kills all performance and makes everything running slow motion and will make taking a save 5-10 minutes and more.
Xeon257
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Xeon257 »

Even after increasing the server autosave interval to 5 minutes, the time it takes for memory to run out seems about the same. The time required to shut down the server has definitely decreased. I could try increasing the interval further, but the amount of memory leakage doesn’t seem to be significantly affected by the save interval. I will try setting it to 10 minutes and test further.

A crash occurred during testing. After checking the log, it seems the crash happened while processing chunks. This is the first time I’ve seen such an error in Factorio. How should I report this type of issue?
robot256
Smart Inserter
Smart Inserter
Posts: 1293
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by robot256 »

You need to disable asynchronous saving completely as a test before making any bug report. Then the server will pause while the save takes place. It will guarantee no new processes are spawned and no additional memory will be consumed. You should measure how much time it takes to complete each save, and see if the memory usage of the main process increases unexpectly. It is still possible there is a memory leak in one of the mods, and this way you can start measuring it.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Xeon257
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: Summary of Multiplayer-Related Memory Issues and Questions

Post by Xeon257 »

This issue has been concluded to be a bug in Factorio. Please refer to the post below.

viewtopic.php?t=131253
Post Reply

Return to “Technical Help”