Enabling swap in embedded systems

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.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
0 Comments
oldest
newest
Boardcon Rockchip and Allwinner SoM and SBC products