Friday, January 05, 2007

Less terminals more memory

How to get more free memory on router box? Answer is easy: remove that things which isn't important and go on. This is an easy and effective hack. Usually we don't need all 8 virtual terminals switched by pressing Alt+F1 to F8. These terminals occupy about 800k per terminal, we have 8 terminals so 6,4MB is taken by not so important processes.
How to do it? Let see into the file "/etc/ttys".

# Virtual terminals
ttyv1 "/usr/libexec/getty Pc" cons25 on secure
ttyv2 "/usr/libexec/getty Pc" cons25 on secure
ttyv3 "/usr/libexec/getty Pc" cons25 on secure
ttyv4 "/usr/libexec/getty Pc" cons25 on secure
ttyv5 "/usr/libexec/getty Pc" cons25 on secure
ttyv6 "/usr/libexec/getty Pc" cons25 on secure
ttyv7 "/usr/libexec/getty Pc" cons25 on secure
ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure

In the middle of beginning there are several lines. To turn off some of theses terminals we will comment corresponding lines by putting "#" at beginning of each line. I left only two first terminals working and get about 5MB of memory to use it in another way.

Labels: , , , ,