Talpadk’s Blog

July 28, 2009

A tale of swap

Filed under: Embedded — talpadk @ 10:19 am

A couple of days ago I ran an apt-get operation on my newly reinstalled Freerunner.
Around 30% it paused.
At first I did not think much of it as the first apt-get operation after a boot usually takes longer as the files it uses are not cached in RAM.

After some time I started to get annoyed, apt-get had obviously hung it self.
Tried to start top, everything was bogged down, finally it started.
First thing that struck my eye, a load of 6!
Second thing, most of the processes did not use that much CPU.
Third thing, no swap.

I issued the swapon command, almost immediate improvement.
Something had started eating memory and fast, swap usage climbed like a R/C glider.
It did however level out at some 20-30MB, and best of all apt-get started moving again.


  1. Swap can improve the operating speed of a Freerunner (might wear the SD card faster, but who cares?)
  2. I hope the next generation free cell phone has more RAM
  3. Apt seems to have some sort of slow fall back in case it can not malloc the RAM it wants. (kudos to the developers of apt for this feature)

Create a free website or blog at WordPress.com.