-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling Vulkan shaders with less than 50% of free memory leads to OOM situation and system freeze #227
Comments
Well, as far as I understood, fossilize itself uses shared memory across all processes. So this is probably rather a behavior of the graphics driver. In Could you check how while true; do date; cat /proc/buddyinfo; sleep 15; done | tee buddyinfo.log Also, I don't think running a Linux system without swap is a supported configuration unless you disable over-committing - which you probably don't want to. You should have at least some swap, maybe even as zram. 512 MB to 2 GB should be enough. Swap doesn't make your system slower, having too few RAM makes the system slower because you're going to experience cache thrashing under memory pressure, and this may result in early memory fragmentation (as the logger above could show) which makes it harder for the kernel to fully utilize your RAM effectively. Does you system have PSI enabled? (see |
I have just tested this. The amount of shared memory appears to be minimal, so the effective usage of each process appears to be around 500 MB of RAM. Please see the screenshot below: Here is the buddyinfo log: As for PSI, it is not enabled. Regarding the fact that swap doesn't make your system slower, it actually does and this is the only reason why I disabled it. The system becomes visibly, noticeably slower and laggier when it starts swapping. It remains snappy and fast when it is disabled (or once I disable it and it brings everything back to RAM). On top of this, I am currently experiencing a bug which makes the system swap out aggressively even when just 4 out of 16 GB are occupied, which makes it basically impossible to use the computer normally. I don't know if this can help, but this is from journalctl when the system froze during compilation: |
Yes, that's usually due to memory fragmentation. At this point it looks quite fragmented but it recovers later:
("Normal" is the interesting data point here, 23083 isolated free 4k pages, then 4417x 8k pages, 2677x 16k pages etc, that means if the kernel needs consecutive memory of 2 MB, it won't find it and has to swap out other pages or flush cache to create an area of 256 consecutive pages, take note: these are small isolated areas of memory because they are surrounded by memory that the kernel cannot move or swap out, user-space memory is movable) Interestingly, SHR usage of fossilize is more like 180 MB for me (with RES around 256 MB). Could you try running this after booting, and only then start fossilize? echo within_size | sudo tee /sys/kernel/mm/transparent_hugepage/shmem_enabled
echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo defer+madvise | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
echo 64 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none
echo 8 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_swap
echo 32 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_shared It may also help your situation with only 4 GB occupied, and the system should not start swapping early (if you enabled swap). If it helps, your distribution should change hugepage defaults. Also, try booting with |
Sorry for my terribly late reply. Thank you so much for your explanations. I have tested this on multiple kernel versions at this point, and both with and without the commands you provided. It looks like the issue with swap kicking in way too early was fixed in the meantime, so that specific one is not there any more (to be specific, I am using the Xanmod kernel, as you can see from the report I opened in their GitHub). When it comes to the behaviour of fossilize_replay, however, I see no difference: if I have less than 8 GB of free memory, the system still freezes when swapping is disabled, as the memory usage of fossilize_replay processes stays the same even after running the commands you gave me. I have tried booting with |
Your system information
Please describe your issue in as much detail as possible:
My system does not have swap configured, which means once the RAM is all occupied the system can't simply use swap to get out of an OOM situation.
What I expect to happen: Steam detects how much memory is available and spawns fossilize_replay processes accordingly so as not to get into an OOM situation, instead of spawning a process for each logical CPU.
What actually happens: Steam spawns the maximum number of fossilize_replay processes it thinks the system supports (in my case, 16 processes). As each process takes up ~512 MB of RAM, this means the system needs at least 8 GB of free RAM. Whenever this is not the case, e.g. because you have other apps open, the system freezes and stops responding. I have tried leaving the system in this state for up to 15 minutes, but the only way to get out of this freeze is to perform a reset (ctrl+alt+printscreen+REISUB).
I have experienced this several times and it is consistently reproduceable.
Steps for reproducing this issue:
The text was updated successfully, but these errors were encountered: