Small-Memory(1).pdf

(14 KB) Pobierz
Small Memory mini-HOWTO
Small Memory mini−HOWTO
Todd Burgess
tburgess@uoguelph.ca
2000−12−12
Revision History
Revision 0.1
2000−12−01
Revised by: tb
Describes how to run Linux on a system with a small amount of memory.
Small Memory mini−HOWTO
Table of Contents
1. Introduction. ....................................................................................................................................................1
2. Linux Kerne. ...................................................................................................................................................2
3. Virtual Consoles. .............................................................................................................................................3
4. Daemons. ..........................................................................................................................................................4
4.1. inetd ..................................................................................................................................................4
4.2. lpd .....................................................................................................................................................5
4.3. nfsd and mountd. ...............................................................................................................................5
4.4. portmap. ............................................................................................................................................5
4.5. sendmail. ...........................................................................................................................................5
4.6. others. ................................................................................................................................................5
5. Conclusions. .....................................................................................................................................................6
i
184432091.001.png
1. Introduction
Assuming buying more memory is out of the question there are many things you can do to tighten up
memory usage in Linux.
Many Linux distributions out of the box are quite bloated from a memory perspective. They run more
services and offer more features than most of us will ever need. By removing many of these services you can
free up several megabytes of real memory.
My own system is a 486DX2−66 with 12MB of physical memory and 12MB of swap space. It has run Linux
for the last 3 years quite happily, and hopefully it will run Linux for several more years. :)
1. Introduction
1
2. Linux Kernel
All the Linux kernels which come with distributions are quite bloated and contain more features than any of
us will ever need or use. If you have not re−compiled your own kernel, it is highly recommended that you do
so. How to re−compile a kernel is beyond the scope of this document, but many excellent Linux books and
guides cover this subject in intimate detail.
If you do re−compile your kernel, remember to put in no more features than you need. For instance: how
many of you include PLIP support in your kernel? How many of you who include it actually use it? Smaller
kernels require less time to load, use less memory, and use less CPU cycles.
Another thing is modules. I personally do not use them because I found them to be a cumbersome. If you use
them and like them then they can help to relieve "kernel bloat."
2. Linux Kernel
2
3. Virtual Consoles
VCs are a great way to free up memory. Most Linux distributions run about 6 of them out of the box. On
average running 6 VCs requires about 4MB of memory. Removing a couple of them can free up a couple
MBs of memory. Most users can get away with running only 3 or 4 VCs. How many you choose to remove is
a matter personal preference. Just remember that the fewer you run, the more memory your applications will
have to run.
The file which outlines how many VCs get loaded is /etc/inittab . In order to remove VCs:
1. Load /etc/inittab in a text editor.
2. Look for a line which looks like the following line (the key feature being a line which starts with c1):
c1:12345:respawn:/sbin/getty tty1 38400
linux
Start at the highest number (i.e. c6) and comment it out by inserting a '#' in the first row. Repeat this
step as many times as needed. Remember every line you comment out is one less VC running.
3. Re−boot the system for your changes to take effect.
3. Virtual Consoles
3
 
Zgłoś jeśli naruszono regulamin