Since a few days ago I am experiencing severe memory leaks when I go back to the game after a standby+resume. The game was not shut down during the standby, so it involves tabbing back into the paused game and going back to playing.
The memory leak is rapid and goes to about 20GB usage when my ram runs out and my system starts swapping. This is when I noticed it, because the kswapd0 process takes up all my CPU power and factorio UPS/FPS go down and down and down. If I just let it run for more than a minute like this my entire system will become inoperable (presumably at some point the oom killer would kick in, but since swapping at that point makes the system effectively unresponsive, who knows how long that would take).
This started either after one of the last 2 patches or after a system update, or after I changed my xfwm4 vblank method to "xpresent" to fix some other issues. I have not seen similar behavior from any other program, so for now I'm inclined to believe it might be a factorio thing.
I have also noticed that the memory usage of the game goes up by about 2GB if left paused and tabbed out for a while. Might be completely unrelated and fine though, since it goes back down those 2GB immediately once the game gets focus again.
What would my next steps be in information gathering for this?
Log file attached, but doesn't have anything interesting as far as I can tell.
Memory timeline:
Game has been running for a while normally
Standby & Resume then going back into the game
[2.0.42][linux] Severe memory leak after standby resume
-
- Burner Inserter
- Posts: 17
- Joined: Wed Apr 05, 2023 12:26 pm
- Contact:
[2.0.42][linux] Severe memory leak after standby resume
- Attachments
-
- factorio-previous.memory-leak.log
- (26.76 KiB) Downloaded 30 times
Re: [2.0.4][linux] Severe memory leak after standby resume
I’ll leave this to the Linux guys but in general we do not support going to sleep while the game is running.
Operating system “sleep mode” is supposed to be transparent to applications. As in: we should not need to do anything special and it should “just work” to put the operating system into sleep and resume.
However, history has shown that’s a big fat lie and you get all kinds of issues with programs when the OS goes through a sleep and resume cycle.
Operating system “sleep mode” is supposed to be transparent to applications. As in: we should not need to do anything special and it should “just work” to put the operating system into sleep and resume.
However, history has shown that’s a big fat lie and you get all kinds of issues with programs when the OS goes through a sleep and resume cycle.
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.42][linux] Severe memory leak after standby resume
Thanks for the report. Unfortunately, I have been unable to replicate this behavior on my machine.
Which distro are you running, and does the same thing happen if you run the game on Wayland?
Which distro are you running, and does the same thing happen if you run the game on Wayland?
Don't forget, you're here forever.
-
- Burner Inserter
- Posts: 17
- Joined: Wed Apr 05, 2023 12:26 pm
- Contact:
Re: [2.0.42][linux] Severe memory leak after standby resume
Distro/kernel: 6.12.20-2-MANJARO
I have never tried Wayland, since I'm using XFCE and as far as I know they are sadly very slow in supporting Wayland.
Is there anything I could try to gather more debug information?
I added some system information as attachment here.
> but in general we do not support going to sleep while the game is running.
Understandable. And it very well might not be factorios fault at all. Since it only started happening after a recent update, I thought I'd bring it up. But it's no big deal to me if this doesn't get looked at anymore.
I have never tried Wayland, since I'm using XFCE and as far as I know they are sadly very slow in supporting Wayland.

Is there anything I could try to gather more debug information?
I added some system information as attachment here.
> but in general we do not support going to sleep while the game is running.
Understandable. And it very well might not be factorios fault at all. Since it only started happening after a recent update, I thought I'd bring it up. But it's no big deal to me if this doesn't get looked at anymore.
- Attachments
-
- inxi.txt
- (16.86 KiB) Downloaded 29 times
Re: [2.0.42][linux] Severe memory leak after standby resume
Manjaro isn't best known from stability, being Arch derivative, which itself is a rolling system. Can you try on another distro?
Re: [2.0.42][linux] Severe memory leak after standby resume
I will second the recommendation against Manjaro. Vanilla Arch is significantly more stable from my experience.
If I get access to a secondary PC in the future I will throw manjaro on it and see if I can reproduce. But for now, I'm moving this to minor issues.
If I get access to a secondary PC in the future I will throw manjaro on it and see if I can reproduce. But for now, I'm moving this to minor issues.
Don't forget, you're here forever.