[2.0.42][linux] Severe memory leak after standby resume

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
feofeujo32m3r
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Apr 05, 2023 12:26 pm
Contact:

[2.0.42][linux] Severe memory leak after standby resume

Post by feofeujo32m3r »

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
memory_leak_after_reloading_save_and_waiting_40_minutes_paused.png
memory_leak_after_reloading_save_and_waiting_40_minutes_paused.png (58.25 KiB) Viewed 389 times

Standby & Resume then going back into the game
memory_leak_after_standby_resume.png
memory_leak_after_standby_resume.png (60.46 KiB) Viewed 389 times
Attachments
factorio-previous.memory-leak.log
(26.76 KiB) Downloaded 30 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15329
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.4][linux] Severe memory leak after standby resume

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 719
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.42][linux] Severe memory leak after standby resume

Post by raiguard »

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?
Don't forget, you're here forever.
feofeujo32m3r
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Apr 05, 2023 12:26 pm
Contact:

Re: [2.0.42][linux] Severe memory leak after standby resume

Post by feofeujo32m3r »

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.
Attachments
inxi.txt
(16.86 KiB) Downloaded 29 times
User avatar
pioruns
Fast Inserter
Fast Inserter
Posts: 111
Joined: Tue Nov 05, 2024 3:38 pm
Contact:

Re: [2.0.42][linux] Severe memory leak after standby resume

Post by pioruns »

Manjaro isn't best known from stability, being Arch derivative, which itself is a rolling system. Can you try on another distro?
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 719
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.42][linux] Severe memory leak after standby resume

Post by raiguard »

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.
Don't forget, you're here forever.
Post Reply

Return to “Minor issues”