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)

1 Comment »

  1. I don’t think conclusion 3 is true. If system is really low on memory, it will drop disk caches and even executable .text. Which results in really bad performance you saw. Swap helps.

    Comment by Pavel Machek — July 28, 2009 @ 10:47 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: