[SOLVED] Low RAM system - hard freeze when RAM is full

Hi folks

I have a little Asus netbook E200H. 32bit UEFI, Cherry Trail processor, strange sound card. All in all, pretty bad hardware to run Linux, but with the recent advances in hardware support with kernel 4.x I've been able to solve all of it's problems except for one.

The device has 2GB RAM, but Manjaro reports 1.8GB. When you deduct the shared video RAM, it's even less. However, it has an eMMC, and while it's no proper SSD, it's hell of a lot better than spinning HDD.

I've noticed that as the RAM fills up the device slows down until it hard locks and needs hard reset. In fact, if you fresh boot a system, open long video in YouTube and let it run, initially it works flawlessly but as, presumably, the video buffers to RAM the device slows down and freezes. Solution to me seems to be to get the system to swap to the eMMC storage. So, I installed systemd-swap and enabled it, but no matter how full the RAM gets 'free -m' shows that the system is not using swap. For exampe, this happens:

              total        used        free      shared  buff/cache   available
Mem:           1883        1451          66         304         365          24
Swap:             0           0           0
Total:         1883        1451          66

I don't know a huge amount about RAM management, but it seems to me that at 24MB avaliable and system so slow that it's almost unusable the device should be starting to utilise swap.
I used Mint for a while before this, and althrough the issue was there as well, it happened a lot more rarely, so I know there's improvements to be made.
Any suggestions on how to get it to be more liberal with swapping?

Please post:

cat /etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=5F99-2E58                            /boot/efi      vfat    defaults,noatime 0 2
UUID=8aca0493-ecae-4451-9486-ad07571a58c1 /              ext4    defaults,noatime 0 1

I have not modified /etc/fstab from the default (yet). My understanding was that this is not required with systemd-swap.

You need to list your swap partition in fstab, did you create a swap partition?

sudo lsblk -f

Sorry I didn't notice the comment that you were using systemd-swap.

No, I don't have a swap partition. I'm trying to use systemd-swap as per instructions found on the Arch Wiki to swap to a dynamic swapfile.

I like this approach better than partition because dynamically resized file is a lot more flexible than a partition when the eMMC storage is only 32gb in itself.

Yes, I can understand that with limited storage. I did not notice that comment initially. I've never used systemd-swap, so I really am not the one to offer advice in that area. I do know the setup is more complex than a static swap partition.

1 Like
sudo lsblk -f
[sudo] Passwort für sgs: 
NAME   FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
├─sda1 ext4         5b72ae92-72ba-4477-93d5-d203b2ed659d                
└─sda2 ext4         9030b9ef-9aab-4578-92c7-b085e2b31cbb  128,9G    38% /mnt/9030b9ef-9aab-4578-92c7-b085e2b31cbb
├─sdb1 ext4         4aaa187d-9945-433d-8bd2-309afbb8e717                
├─sdb2 ext4         04d0077e-4517-4d2c-86d6-f3f60acc4712                
└─sdb3 ext4         7f6150d0-61f3-4b08-831b-7524c7c0a553   25,3G    49% /
├─sdc1 ext4         19d386cd-18e8-4637-948e-59f6bfad43bd                
├─sdc2 ext4         99bb58e3-fabc-4261-a1e8-2b6caa4bafd7                
└─sdc3 ext4         967be3aa-542a-406c-b83f-b6ff76942183                
├─sdd1 ext4         2e512fee-d203-4039-8542-4f05df5a8787                
└─sdd2 ext4         85280a85-6b60-4a43-89cf-f636a08ef478                
zram0                                                                   [SWAP]

Not very difficult to setup as SGS illustrates, the main issue can be to check hibernation ord swap leftover in grub & hosts.

It's efficient with any storage size.
Today, I run on this :

~]$ free
              total       utilisé      libre     partagé tamp/cache   disponible
Mem:          11783        1895        6504        1117        3383        8455
Swap:           511           0         511

There are some recently written instructions on the Manjaro Wiki for automating swap with systemd-swap. Could be worth giving them a try. :slightly_smiling_face: https://wiki.manjaro.org/index.php?title=Add_a_/swapfile#Automated_Swap_Management_with_systemd-swap Make sure to first undo whatever changes you made following the Arch Wiki first so that they don't conflict.

(Although not necessary it may be worth reading/experimenting with the Tuning and Performance Considerations section that follows to customise the swapping behaviour - how soon and easily swapping will occur - to your own needs.)

1 Like

Thank you to all who replied. I've solved it, although I'm not certain what did it.
Even through I had restarted the system after every config edit, and my systemd service was showing as 'active (exited)', the swap did not actually start working until I had issued

sudo systemctl status systemd-swap

Following that, the command 'free' shows 511MB of swap, and having increased swappines the system starts swapping when it has less than 400ish MB (which is probably too high swapiness, I'll have to play with that). It also dynamically increases swap size when needed (I've pushed it to 2gb of swap) which is such a beautifully elegant solution maximising performance while minimising disk utilisation that I'm still in awe.
And of course, I haven't had a hard freeze since swap has been enabled.

Thank you all so much for your support.


So I changed the Titel to [SOLVED]. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.