Enabling swap in embedded systems

Orange Pi Development Boards

If your embedded system running Linux does not have enough memory, you can enable swap to get more memory.

However if your platform does not have MMU (Memory Management Unit) as is the case for Sigma Designs EM8620 series, it won’t support swap, so forget it.

If your platform does have MMU, as is the case for many newer platforms such as Sigma Designs SMP8630, SMP8640 and SMP8650 series, you can enable swap support.

First you’ll have to make sure swap support is enabled in your kernel:

and swapon/swapoff is enabled in busybox.

So for example if you have an IDE harddisk with the second partition configured as swap. (Use fdisk to create a partition and mkswap /dev/hda2 to initialize the partition), you can enable the swap as follows:

If you get out-of-memory killer kernel error, you can change the “swapiness” to avoid oom-killer to kick in.

Leave a Reply

Notify of