On Sat, 2011-04-02 at 02:22 +0700, Pandu Poluan wrote:
> Good grief! How'd you do that?!
> 
> *bow in respect*
> 
> Rgds,
> 
> 

Well, firstly, I managed to get it down to 3MB (though I cheated *a
little*):

lilpenguin ~ # sync ; echo 3 > /proc/sys/vm/drop_caches # kinda cheating
lilpenguin ~ # free -m
             total       used       free     shared    buffers
cached
Mem:            43          5         37          0          0
1
-/+ buffers/cache:          3         39
Swap:            0          0          0
lilpenguin ~ # uname -srm
Linux 2.6.36-gentoo-r8 x86_64
lilpenguin ~ # df -h 
Filesystem            Size  Used Avail Use% Mounted on
/dev/vda1             4.0G  157M  3.6G   5% /
shm                    22M     0   22M   0% /dev/shm


So what it is is this:

* kvm with virtio devices
* no udev (static /dev)
* serial console only
* no services in default runlevel
* tight module-less virtio-based kernel (booted externally)
* no extra (virtual) hardware
* everything compiled with -Os

I got the disk space down low by removing everything not needed to boot
and get into the system (which means the portage tree, compiler, etc),
but that has nothing to do with the memory usage.

I could probably get it lower by tweaking the kernel a bit more.  Also
it would probably use slightly less RAM if it were 32-bit.  Also, the
biggest user of memory are /bin/bash and /bin/login.  I could minimize
memory further by making the login shell ash or dash.



Reply via email to