Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: How low can you go?
Date: Sat, 02 Apr 2011 06:26:16
Message-Id: AANLkTi=Jf1xQJEgTduRT05y-yue5gk=-YTou4mrO7Gyd@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: How low can you go? by Albert Hopkins
1 On Sat, Apr 2, 2011 at 03:28, Albert Hopkins <marduk@×××××××××××.org> wrote:
2 > On Sat, 2011-04-02 at 02:22 +0700, Pandu Poluan wrote:
3 >> Good grief! How'd you do that?!
4 >>
5 >> *bow in respect*
6 >>
7 >> Rgds,
8 >>
9 >>
10 >
11 > Well, firstly, I managed to get it down to 3MB (though I cheated *a
12 > little*):
13 >
14 > lilpenguin ~ # sync ; echo 3 > /proc/sys/vm/drop_caches # kinda cheating
15 > lilpenguin ~ # free -m
16 >             total       used       free     shared    buffers
17 > cached
18 > Mem:            43          5         37          0          0
19 > 1
20 > -/+ buffers/cache:          3         39
21 > Swap:            0          0          0
22 > lilpenguin ~ # uname -srm
23 > Linux 2.6.36-gentoo-r8 x86_64
24 > lilpenguin ~ # df -h
25 > Filesystem            Size  Used Avail Use% Mounted on
26 > /dev/vda1             4.0G  157M  3.6G   5% /
27 > shm                    22M     0   22M   0% /dev/shm
28 >
29 >
30 > So what it is is this:
31 >
32 > * kvm with virtio devices
33 > * no udev (static /dev)
34 > * serial console only
35 > * no services in default runlevel
36 > * tight module-less virtio-based kernel (booted externally)
37 > * no extra (virtual) hardware
38 > * everything compiled with -Os
39 >
40
41 Unfortunately, I can't go module-less; xtables-addons requires modules support.
42
43 How do you get static /dev ?
44
45 > I could probably get it lower by tweaking the kernel a bit more.  Also
46 > it would probably use slightly less RAM if it were 32-bit.  Also, the
47 > biggest user of memory are /bin/bash and /bin/login.  I could minimize
48 > memory further by making the login shell ash or dash.
49 >
50
51 I also rely on lots of bash scripts.
52
53 *sigh* ... I'll never get it as small as yours... but still I *am*
54 interested in your memory-saving tricks :-)
55
56 Rgds,
57 --
58 Pandu E Poluan
59 ~ IT Optimizer ~
60 Visit my Blog: http://pepoluan.posterous.com

Replies

Subject Author
Re: [gentoo-user] Re: How low can you go? Albert Hopkins <marduk@×××××××××××.org>