[XA2] bad memory handling, lots of OOM killing
I do have this right from the beginning using the XA2.
It seems related to browser usage or lipstick or aliendalvik or just SFOS as free/htop/... do not really reveal anything.
It caused not starting of camera (of course when trying a snap shot) and not starting the camera light as bulb. Or just killing ANY running application (INCLUDING native ones), even terminal with open script running.
I eventually could not stand this anymore and used a swapfile solution I have on my N900 since aeons. Not the best eMMC related solution but working quite fine for now....
#!/bin/bash
if [ "" != "$1" ]; then
dd if=/dev/zero of =/home/.swapfile bs=1M count=1024
mkswap /home/.swapfile -L mySwapFile
fi
MyLoopDev=$(losetup -f)
losetup -d /dev/$MyLoopDev
losetup $MyLoopDev /home/.swapfile
swapon $MyLoopDev
Call it once with any parameter to create a swap file of 1G. And call it after a reboot to activate the additional swap.
May need a systemd script....
Can't say I noticed this problem. However, the XA2 uses 512MiB of zram as swap. You could try increasing that a bit. Unfortunately I can't find where this is actually configured. There is
zramctl
now, but for a more permanent solution I was looking for some config or systemd service to tweak.Also unfortunately the zswap module (stil?) isn't available in the kernel.
Fuzzillogic ( 2019-12-22 19:09:16 +0200 )editThanks. I know that, but after experiences with zram under Maemo and the 'small' amount of RAM on XA2 (3GB) I thought just try a known working solution. :)
My JollaC has also 'only' 3GB and I never had such problems.
peterleinchen ( 2019-12-22 23:34:07 +0200 )edit@Fuzzillogic: I also wondered where zram is actually set up and after about an hour of digging through the several filesystems I actually found it in /vendor/etc/fstab.pioneer
@peterleinchen: I would recommend increasing zram over placing a swap file on emmc, but if you want to make the swap persistant across reboots, just add an entry to /etc/fstab.
Also instead of wasting space in /home, why not use one of the backup partitions that are not actually used by SfOS? On my device, mmcblk0p69 (/odm mirror, 450MB), mmcblk0p70 (/opt mirror, 850MB) or mmcblk0p78 (/fimage mirror, 2.8GB) would seem like good canidates. I would not expect that reformatting those to use as swap will brake anything, but try at your own risk...
lethe ( 2019-12-23 02:49:19 +0200 )edit/vendor/etc/fstab.pioneer smells like aliendalvik setting?
swap files are not mounted, so fstab claiming:
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
On my XA2 DS I do not see above mentioned partitions with blkid. (edit: of course, with lsblk they show up
One could also use SD card for the swap file location (like I did on N900 for years with the same card). But I have all data on SD and use internal mmc only 'temporary'...
And I did not research about unused partitions (possibly risking breaking the flash back to Android?) whereas on my N9 I did so :)
peterleinchen ( 2019-12-23 13:54:31 +0200 )edit