1

I am using a 16gb USB Thumb Stick for a swap drive because I need to do a very memory intensive process. The swap drive says it's listed and installed, but the ODROID is freezing from a lack of memory when it hits 2GB's. Here is the info.

uname -a

Linux odroidxu4 4.9.11-odroidxu4 #12 SMP PREEMPT Thu Feb 23 22:10:22 CET 2017 armv7l GNU/Linux

sudo fdisk -l

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk1p1       8192 30493951 30485760 14.5G 83 Linux

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     8064 30719999 30711936 14.7G  b W95 FAT32

/etc/fstab

UUID=78fe8581-c55e-4665-bbf1-724ea046a7c3 none swap sw,pri=5 0 0
UUID=4d62b70f-fbde-4e55-bf71-089484f36c8f / ext4 errors=remount-ro 0 1 
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0

sudo swap -s

master@odroidxu4:~$ sudo swapon -s
Filename                Type        Size    Used    Priority
/dev/sda1                               partition   15355964    0   -1

blkid

/dev/mmcblk1p1: UUID="4d62b70f-fbde-4e55-bf71-089484f36c8f" TYPE="ext4" PARTUUID="d528b458-01"
/dev/sda1: UUID="78fe8581-c55e-4665-bbf1-724ea046a7c3" TYPE="swap" PARTUUID="cf5e55bf-01"
/dev/mmcblk1: PTUUID="d528b458" PTTYPE="dos"

But when the active process runs, swap is clearly not working. When I use free -m you can see that I am completely out of RAM and the swap still says 0.

master@odroidxu4:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1950       1913         37          9          0         11
-/+ buffers/cache:       1901         48
Swap:        14996          0      14996

Currently the ODROID is freezing and shutting down from a lack of memory.

Any thoughts on how I can fix this?

mount

master@odroidxu4:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=187287,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=399444k,mode=755)
/dev/mmcblk1p1 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,relatime)
/dev/mmcblk1p1 on /var/log.hdd type ext4 (rw,relatime,errors=remount-ro)
log2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51200k,mode=755)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=199724k,mode=700)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=199724k,mode=700,uid=1000,gid=1000)

trying mkswap right now as well...

Actually that last mkswap turned my swapon -s to

master@odroidxu4:~$ sudo swapon -s
Filename                Type        Size    Used    Priority
/dev/sda1                               partition   15355964    0   -2
/var/swap                               file        131068  0   -1
  • Have you done mkswap /dev/sda1? – Rui F Ribeiro Mar 2 '17 at 22:13
  • i did swapoff, then mkswap, then I updated fstab with the new UUID, then swapon .... and it still breaks – Nefariis Mar 2 '17 at 22:25
  • I deleted my comment about the lack of swap mount-point after reading syshell.net/2015/07/11/odroid-add-swap-space. – Timothy Martin Mar 2 '17 at 22:29
  • should I reformat my swap and start over? ... can someone point me to the guide that they would use? – Nefariis Mar 2 '17 at 22:32
  • Your fdisk -l output for /dev/sda1 shows W95 FAT32 for the type. Should that not be type 82? – Timothy Martin Mar 2 '17 at 22:42
1

The Odroid C2 has a 32-bit processor, which means it provides a virtual address space of 4 GB. Of this 4 GB, 2 GB is available to user space, the remaining 2 GB is reserved for the kernel (assuming the kernel is configured with CONFIG_VMSPLIT_2G). This means a single process can only grow to 2 GB in size.

With today's growing RAM sizes the 32-bit address space is getting small very fast.

You could try to split the memory intensive process into several smaller processes. Or move the application to a 64-bit computer.

  • Its an XU4, an ARM processor. – Nefariis Mar 3 '17 at 6:38
  • Ok, I missed that is was an XU4, and not a C2. But this board also has a 32-bit processor: the Cortex-A15 and Cortex-A7 cores are not 64-bit. – Johan Myréen Mar 3 '17 at 7:03
  • The C2 does in fact have a 64-bit CPU (Cortex-A53), sorry for the confusion. But the XU4 is definitely 32-bit. – Johan Myréen Mar 3 '17 at 7:15
0

Your swap partition has the wrong type. fdisk -l should return 82 for Id and Linux swap / Solaris for System. mkswap /dev/mmcblk1p1 should create the correct type.

Please refer to https://help.ubuntu.com/community/SwapFaq. Another guide would be: http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/.

  • 1
    The Linux kernel does not care what the id is. Besides, the swap is recognized as can be seen from the output of free -m in the listing above. – Johan Myréen Mar 3 '17 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.