Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a small embedded linux kernel and file system created via buildroot that is installed onto a compact flash drive running on an x86 board. I am using an initramfs (due to power loss concerns) but mounting a small number of directories on ext3 partitions on the CF drive for data that has to be persistent. However, recently I have been reading about swap partitions and their uses and as my current setup does not employ a swap partition at all. I am wondering if this is safe? I do not anticipate that the applications running on the device will be using a great deal of memory but is it better to create a swap partition regardless? I am very conscious of the limited writes that can be made to CF devices so if it is not vital then I would prefer not to use a swap partition. What would be the worst case scenario if I go ahead without a swap partition?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

No, this is not a bad idea. Many devices that you may find around are running linux without swap partition. For example, there are many DLink router models with linux inside. The only possible issue is that it may run out of memory. However, with embedded solutions this should not happen if the system is properly designed (no memory leaks, e.t.c.) and user is not allowed to start any extra programs on his own.

share|improve this answer

You should configure memory so the normal workload fits in it (disk is much, much slower than memory). Embedded devices, by their very definition of running a limited, fixed workload, have very predictable memory requirements. So it doesn't make sense to add swap.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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