I've been running arch linux for quite a few months and it has been the best distribution i've used. However, sometimes, it just decides to freeze. I may be using the computer, the bottom bar shows the CPU load is at 0.30, perfectly normal, then all of sudden it starts going up, 1, 3, 5, 10 and goes beyond 20 if I let it. The whole system becomes unresponsive and I can't even kill X. I'm pretty sure it's my browser the one which is doing that, since when I realize the load is going up, I can kill it and everything goes back to normal. However this happens both with firefox and chromium, which leaves me thinking it might be a flash bug, however, everything is up to date and I don't see anyone else complaining about it. Is there some way I can profile it to make sure what is the process taking over the CPU?
Sometimes the CPU cooler is not properly mounted, so you need to check the CPU temperature.
If you have some issues and you don't know what it is, then the best approach is the black-box testing. To do that, remove some components, sound-cards, drives, GPU and so on. If you still have issues try another OS.
Sounds like hardware I/O failure; the reason the load average goes up is because multiple process are trapped in uninterruptible sleep. It also tends to max out the CPU1 because the kernel is busy looping trying to access a hardware device that is malfunctioning.
In short, the kernel does not deal with the situation very well because there not much point in trying to compensate for failing hardware on a low level. You will probably find lots and lots of evidence of the problem if you look in the system logs afterwards. Chances are you have a hard drive with some bad blocks on it; this may be repairable, although you have not described the problem in sufficient detail2 for me to offer an opinion.
If the problem is bad blocks, you can check decisively by running
e2fsck -c on all the (ext) partitions you normally have mounted; they'll have to be unmounted so you may need to use a live CD for this. An extra
-y could be used too, although the former will require quite a bit of time. Make sure you look at
man e2fsck so you understand what this is about.
1. Note that CPU usage and load average are not the same thing, although the way this is reported by some tools can be confusing.
2. How long has this been recurring, how often does it happen, how long does it last.
What graphics chipset do you have? Newer kernels have a huge problem with some Intel graphics chipsets, like Intel 82845G "Brookdale". Do this:
lspci -v | grep -i -A8 VGA
Then google for "Arch Linux" and whatever chipset you find.