Swap File Crash Ubuntu

   721   5   0
User Avatar
Member
32 posts
Joined: 9月 2016
オンライン
Rendering a scene that tops out my ram (32gb on both machines) so it needs some swap to pull it off. On windows 11 it worked fine by increasing the swap, on ubuntu it keeps on crashing with the same amount of swap.

The amount of swap seems a bit high too. On windows it worked for the first 30 frames with 48gb swap and had to up it to 72gb to keep going.

Might be some tweaking of how the swap gets used in Ubuntu I'm missing?..

The swap only gets used in starting the render once it gets going its fully on ram and running full tilt.
Edited by dany27227 - 2025年7月15日 07:40:40
User Avatar
スタッフ
640 posts
Joined: 8月 2019
オフライン
Linux has a "swappiness" value that tells the OS how aggressively it should utilize the swap space. This value is between 0 and 200, where 0 indicates minor swapping, and 200 means "use the swap space at all costs".

You can check the current value by running: cat /proc/sys/vm/swappiness
You can change the value by running: sudo sysctl vm.swappiness={value}
You can make the value permanent by adding vm.swappiness = {value}to /etc/sysctl.conf
Note that larger numbers can negatively affect performance, so choosing the right number is a bit of a balancing act. This site has a good explanation: https://phoenixnap.com/kb/swappiness [phoenixnap.com]

Try increasing the number and see if it makes any difference.
Edited by johnmather - 2025年7月15日 10:30:15
User Avatar
Member
32 posts
Joined: 9月 2016
オンライン
150 wasn't enough, 200 did it.
User Avatar
Member
32 posts
Joined: 9月 2016
オンライン
Did two frames and now back to crashing at 200...
User Avatar
Member
32 posts
Joined: 9月 2016
オンライン
Found this post with two possible explanations:
https://askubuntu.com/questions/1487392/why-does-memory-heavy-processes-lead-to-system-crashes-when-swap-is-available [askubuntu.com]

The badblocks theory lines up because I wasn't getting the crash on my windows machine that had the same 32gb ram and big swap config. The windows machine had the swap on a newer m.2 drive.
User Avatar
Member
32 posts
Joined: 9月 2016
オンライン
Confirmed the problem was probably the drive (very old ssd). Just tested the scene on a machine running ubuntu (now 24 problem was happening in 22) w/ 32gb and big swap on a new m.2 with no problem.
  • Quick Links