Click to See Complete Forum and Search --> : Linux memory usage


Cri
11-06-2001, 12:57 PM
Greetings Linux heads,

I have a dual-boot Win98/Red Hat 7.1 machine. I used to have 224MB of RAM, but because RAM is so cheap these days, I recently purchased 2 256MB chips for my box. Therefore, I now have a total of 640MB RAM.

My first problem is that Linux only sees 627MB of memory. Searches on google & google groups bring up the following solution: either A) enter 'mem=640M' at the lilo prompt or B) edit lilo.conf to include the following line 'append="mem=640M"'. Neither solution works for me. If I pass the memory boot parameter to Linux, the system boots fine, but still does not recognize all my RAM. I already have a statement 'append="hdc=ide-scsi hdd=ide-scsi"' listed in my lilo.conf to enable scsi emulation. If I edit this line to read 'append="mem=640M hdc=ide-scsi hdd=ide-scsi"', Linux still doesn't see all available memory (I have to add to the current append line because lilo will not accept 1+ append statements).

Linux not recognizing all available memory seems to be a common problem, and the boot parameters seem to be the common solution, but they do not work in my case. Please note that I had the same problem previously with 224MB of RAM...linux only recognized 218MB and memory boot parameters made no difference. Any suggestions on how to correct this?

My second question is what is up with Linux's memory management? With 224MB of RAM, my system worked fine. Linux usually used close to all recognized memory, and rarely swapped. Since I more than doubled my memory I figured Linux would hardly come close to using all physical memory...I thought it would barely ever have to swap, but I was wrong. Even with 640MB, Linux still uses close to all RAM (when running a bunch of apps), and last night it bit into 30MB of swap. At the time I was using JBuilder, netscape, & xmms...nothing at all unusual. When I was done using these apps, I closed them all and didn't touch my computer for 4 hours or so, but the next time I did, memory usage was the same. Linux does not seem to be recovering unused memory. Likewise, Linux seems to be routinely using about 300+ MB of RAM...with me pretty much doing nothing. Why would this be? Before it didn't even have 300+ MB to work with. Furthermore, I can't say I've noticed any improvement in system performance although I just did a major memory upgrade.

How is Linux memory usage managed? Are my problems indicative of a memory leak? Where can I find documentation on the scheduling scheme (as a CS grad student, I'm interested :). Is there any way I can optimize memory usage for my system?

Any advice would be greatly appreciated.
Thanks in advance to all who reply.

nathaniel
11-07-2001, 12:47 AM
well I can't really help you on the poor memory ussage cause with only 256 / 700mb swap (I run apache/mysql/php while in X) I have nice memory useage, RH might be choking cause it was installed w/ 256 and now has 627


I do know that memory that u may buy will not always be exactly that amount. I bought two sticks of 128mb ram, when I installed it onto my machine it registered 134 w/ one chip and 126 w/another, u possibly got two chips that have just under 256 and combined w/ all the otehrs which may be low Linux totals actual ram to 627 not what your BIOS might post.

NB

Cri
11-07-2001, 02:38 AM
I'm not sure how to check what Linux sees for each dimm (my setup=2 chips at 256MB and a 128MB chip). And I do know that Win98 sees exactly 640MB...so I'm pretty sure all the said RAM is there.

bruce1271
11-07-2001, 05:55 AM
Linux Kernel is made to use as much memory as you provide it. If you keep adding more, it will keep using more. well, It doesnt actually use it, it grabs it and releases it as needed. Only if your system goes into swap often(every time you use it) would I be worried.
You can read more on this in a good Linux sys admin book at Barnes and Noble or wherever.