old-www/LDP/LG/issue37/tag/47.html

209 lines
7.7 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.1H.i">
<TITLE>The Answer Guy 37: RAM</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Guy</font>
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<!-- begin 47 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>RAM</H3>
<p><strong>From Swearingen on Tue, 26 Jan 1999
</strong></p>
<P><STRONG>
Is there a way that I can tell Linux (<A HREF="http://www.redhat.com/">Red Hat</A> 5.2) how much RAM my
machine has?
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Yes.
</BLOCKQUOTE>
<BLOCKQUOTE>
(The churlish imp in me would love to just leave it at
that --- but I supposed you'd actually know <EM>HOW</EM> to
do it).
</BLOCKQUOTE>
<BLOCKQUOTE>
Your kernel is reponsible for all memory management under
Linux. You can pass parameters to your kernel in a number
of ways (depending on how you load it). The most likely
scenario is that you are using LILO (the LInux LOader).
This normally gives a brief prompt, at which you can type in
a variety of parameters.
</BLOCKQUOTE>
<BLOCKQUOTE>
Read the bootparam(7) man page and BootPrompt HOWTO
</BLOCKQUOTE>
<BLOCKQUOTE>
(<A HREF="http://metalab.unc.edu/LDP/HOWTO/BootPrompt-HOWTO.html"
>http://metalab.unc.edu/LDP/HOWTO/BootPrompt-HOWTO.html</A>)
</BLOCKQUOTE>
<BLOCKQUOTE>
for details on the range of parameters that can be
entered. You can also set environment variables which
will be inherited by the init process (and thus by all
other processes).
</BLOCKQUOTE>
<BLOCKQUOTE>
You can type in the mem= parameter there to over-ride the
kernel's automatic memory detection and supply your own
value. That will just affect one session (useful for
testing your system to make sure that it will work with the
value that you propose). To make this change persistent you
can edit the file <TT>/etc/lilo.conf</TT> and add a line like:
</BLOCKQUOTE>
<BLOCKQUOTE><BlockQuote>
append="mem=128M"
</BlockQuote></BLOCKQUOTE>
<BLOCKQUOTE>
... note: The "append" directive in the <TT>/etc/lilo.conf</TT>
"appends" a string to the kenrel's command line (invocation)
so you can have multiple append directives, and I think
you can put multiple parameters within one append= directive
(all separated by spaces and enclosed with the one pair of
double quote signs). You do need the quote signs and the
M (for Megabytes).
</BLOCKQUOTE>
<BLOCKQUOTE>
I've covered this before. Earlier versions of the
Linux kernel couldn't reliably detect memory above 64Mb
on some (most?) systems. However, newer Linux kernels
(2.0.36 and the new 2.2.0) should detect your full
memory capacity automatically.
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course I'm only guessing at the symptom that you're
trying to address. I do know of people who maintain boot
images with <EM>LESS</EM> memory than they have installed. This is
usually done by software developers to allow them to test
their packages under artificial "low memory" and "swap
thrashing" conditions. This can be done exactly as I've
described above.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note: I hope it's obvious that we're talking about
real memory (real chips and SIMMs inside your system) here
--- and not about "virtual memory" (paging/swap space).
The way to increase or disable your swap is to create a
swap partition or a swap file (technically its really a
"paging" partition or file --- but the term swap is misused
throughout the libraries, sources, and documentation).
</BLOCKQUOTE>
<BLOCKQUOTE>
You can run the command "man -k swap" to learn about
the commands and configuration files that relate to
swap files and partitions.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you tell the kernel that your system has more memory than
it really has --- you'll almost certainly crash, almost
immediately.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 47 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1999, James T. Dennis
<BR>Published in <I>The Linux Gazette</I> Issue 37 February 1999</H5>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<P align="center">
<table width="98%"><tr valign="center" align="center">
<td rowspan="3" colspan="4"><A HREF="../lg_answer37.html"><IMG
SRC="../../gx/dennis/answernew.gif"
ALT="[ Answer Guy Index ]"></A></td>
<TD width="8%"><A HREF="./1.html">1</A></TD>
<TD width="8%"><A HREF="./2.html">2</A></TD>
<TD width="8%"><A HREF="./3.html">3</A></TD>
<TD width="8%"><A HREF="./4.html">4</A></TD>
<TD width="8%"><A HREF="./5.html">5</A></TD>
<TD width="8%"><A HREF="./6.html">6</A></TD>
<TD width="8%"><A HREF="./7.html">7</A></TD>
<TD width="8%"><A HREF="./8.html">8</A></TD>
<TD width="8%"><A HREF="./9.html">9</A></TD>
<TD width="8%"><A HREF="./10.html">10</A></TD>
</tr><tr valign="center" align="center">
<TD><A HREF="./11.html">11</A></TD>
<TD><A HREF="./12.html">12</A></TD>
<TD><A HREF="./14.html">14</A></TD>
<TD><A HREF="./15.html">15</A></TD>
<TD><A HREF="./16.html">16</A></TD>
<TD><A HREF="./17.html">17</A></TD>
<TD><A HREF="./18.html">18</A></TD>
<TD><A HREF="./19.html">19</A></TD>
<TD><A HREF="./21.html">21</A></TD>
<TD><A HREF="./22.html">22</A></TD>
</tr><tr valign="center" align="center">
<TD><A HREF="./23.html">23</A></TD>
<TD><A HREF="./28.html">28</A></TD>
<TD><A HREF="./29.html">29</A></TD>
<TD><A HREF="./30.html">30</A></TD>
<TD><A HREF="./31.html">31</A></TD>
<TD><A HREF="./32.html">32</A></TD>
<TD><A HREF="./33.html">33</A></TD>
<TD><A HREF="./34.html">34</A></TD>
<TD><A HREF="./37.html">37</A></TD>
<TD><A HREF="./38.html">38</A></TD>
</tr><tr valign="center" align="center">
<TD><A HREF="./39.html">39</A></TD>
<TD><A HREF="./41.html">41</A></TD>
<TD><A HREF="./42.html">42</A></TD>
<TD><A HREF="./43.html">43</A></TD>
<TD><A HREF="./44.html">44</A></TD>
<TD><A HREF="./45.html">45</A></TD>
<TD><A HREF="./46.html">46</A></TD>
<TD><A HREF="./47.html">47</A></TD>
<TD><A HREF="./48.html">48</A></TD>
<TD><A HREF="./49.html">49</A></TD>
</tr></table>
</P>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<P> <hr> <P>
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../index.html"
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
<A HREF="../../index.html"
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes37.html"
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
<A HREF="../york.html"
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->