[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20001122: Linux shared memory (cont.)



>From:  James Jung <address@hidden>
>Organization:  NOAA/NESDIS
>Keywords:  200011211918.eALJIIo17699 Linux shared memory

Jim,

re: how Linux view shared memory

>I thought so too, but I have 500MB RAM and 1GB swap in this thing and
>can't go beyond ~100 frames.

This definitely refutes my previously held view of how shared memory
works in Linux.  Dave Glowacki's reply about how to increase shared
memory looks to be right on the money.

>When I look at the memory being used, it suggests I'm not even
>using all of the RAM.

OK, this may be most of your problem.  To see how much memory Linux
sees, do either of the following:

o run 'cat /proc/meminfo' and look for the line that defines 'MemTotal:'.

o run top and see how much memory is indicated by the line that begins
  'Mem:' (this will also show how much shared memory Linux is providing)

If the BIOS on your motherboard is not one that Linux knows how to
communicate with, it will be unable to determine exactly how much
memory you have installed in your machine.  In this case the MemTotal:
line from /proc/meminfo will indicate that you only have 64 MB
(expressed in kB).  I am willing to bet that this is what is going on
in your Linux setup.

If this is the case, you have to "tell" Linux exactly how much memory
you have.  You do this by:

<login as 'root'>

cd /etc

edit lilo.conf and add the line:

append="mem=500m'

to the section that starts 'image='.  For example, you might see something
like:

image=/boot/vmlinuz-2.2.16-3
        label=linux-up
        initrd=/boot/initrd-2.2.16-3.img
        read-only
        root=/dev/sda9

You would modify this to read:

image=/boot/vmlinuz-2.2.16-3
        label=linux-up
        append="mem=500m"      /* for computer with 500MB memory */
        initrd=/boot/initrd-2.2.16-3.img
        read-only
        root=/dev/sda9

After modifying /etc/lilo.conf, you have to run 'lilo' to make the change
active:

lilo

Finally, you have to reboot.

After the reboot, a 'cat /proc/meminfo' and a 'top' should show that
your system now sees 500 MB of RAM AND you should see a more sizable
shared memory segment denoted by the 'MemShared:' line in
/proc/meminfo.

If you still don't have enough shared memory, then you will have to
make the modifications that Dave G. suggested in his email:

  ...it looks like you can do this in one of two ways.  

  You can add this line to your /etc/rc.d/rc.local file:

        echo <shared memory size> > /proc/sys/kernel/shmmax 

  and reboot.  (Note that since this will be literally the
  last thing run before your system comes up, your McIDAS
  session won't get a larger shared memory segment if it's
  started during the boot process.)

  Alternatively, you can change the value of SHMMAX in
  /usr/src/linux/include/asm/shmparam.h and rebuild your
  kernel for a more permanent solution.

Please let me and the other Linux users out there know if this helped.

Tom
--
+-----------------------------------------------------------------------------+
* Tom Yoksas                                             UCAR Unidata Program *
* (303) 497-8642 (last resort)                                  P.O. Box 3000 *
* address@hidden                                   Boulder, CO 80307 *
* Unidata WWW Service                             http://www.unidata.ucar.edu/*
+-----------------------------------------------------------------------------+