You are complaining about high memory requirements when compiling KDE4? Have you any concept about how big KDE4 is? KDE4 is a marvellous desktop environment, if you like that sort of thing - but it is huge. It is too big to run on such devices, never mind compile.
Compiling software is typically more demanding (in memory, disk space, and often cpu capacity) than running it. But for most uses, you don't compile system software or standard applications - you get them as binaries with the distribution.
The software compiled on a system like this is mostly small programs - such as those written by the user themselves - and thus they take small amounts of memory to compile.