memory usage, memory clearing

I have a Linux box on a dual pentium with 98 MB RAM as several servers.  It has about 10 aliases with apache running on them, named, sendmail, and a pop3 server.  I can run it just fine on 64 MB RAM and get the same speed.

My problem is all of the memory is in use.  Here is a ps -faxm:
  PID TTY MAJFLT MINFLT   TRS   DRS  SIZE  SWAP   RSS  SHRD   LIB  DT COMMAND
    2  ?       0      0     0     0     0     0     0     0     0   0 (kflushd)
    3  ?       0      0     0     0     0     0     0     0     0   0 (kswapd)
  316  ?       1      4    12   260   272     0   272   224     0  12 update (bdflush)
  313   2     73     10    12   280   292     0   292   240     0  13 /sbin/mingetty tty2
  314   3     72     10    12   280   292     0   292   240     0  13 /sbin/mingetty tty3
   21  ?      34    132    16   292   308     0   308   248     0  15 /sbin/kerneld
  283  ?       5      7    32   300   332     0   332   280     0  13 gpm -t Microsoft
    1  ?     158     32    24   316   340     0   340   276     0  16 init [3]
  160  ?      33     15    32   316   348     0   348   284     0  16 lpd
  149  ?      18  48374    20   348   368     0   368   300     0  17 inetd
 1249  ?     211     54    36   516   552     0   552   432     0  30  \_ in.telnetd
 1250  p0    136     78    24   720   744     0   744   432     0  78      \_ login -h 207.173.16
 1251  p0    163    114   264   412   676     0   676   536     0  35          \_ -bash
 1263  p0    128     71    16   696   712     0   712   416     0  74              \_ su
 1264  p0    151     87   256   444   700     0   700   528     0  43                  \_ bash
 1271  p0     88     26    28   384   412     0   412   320     0  23                      \_ ps
  110  ?      23     22    32   368   400     0   400   308     0  23 syslogd
  130  ?      16   1561    24   388   412     0   412   316     0  24 crond
  119  ?      67     51    28   488   516     0   516   304     0  53 klogd
  312   1    237     79    24   696   720     0   720   416     0  76 /bin/login -- jake
  318   1    193    114   264   408   672     0   672   532     0  35  \_ -bash
  335   1    131     70    16   676   692     0   692   400     0  73      \_ su
  339   1    156    254   260   432   692     0   692   516     0  44          \_ bash
  187  ?      12  35244   200   556   756     0   756   688     0  51 sendmail: accepting connect
 1269  ?       6     25   220   572   792     0   792   720     0  54  \_ sendmail: server [207.1
 1270  ?      12     38   248   632   880     0   880   732     0  64      \_ sendmail: LAA01270
  294  ?      32   6819   168   700   868     0   868   792     0  74 httpd
 1233  ?       0     19   168   700   868     0   868   792     0  74  \_ httpd
 1169  ?      13     51   204   768   972     0   972   772     0  87  \_ httpd
 1170  ?      13     54   204   768   972     0   972   772     0  87  \_ httpd
 1171  ?      13     53   204   768   972     0   972   776     0  87  \_ httpd
  619  ?      17     94   204   772   976     0   976   764     0  88  \_ httpd
 1157  ?      15     68   204   772   976     0   976   764     0  88  \_ httpd
  944  ?      13     59   204   772   976     0   976   772     0  88  \_ httpd
 1167  ?      13     59   204   772   976     0   976   768     0  88  \_ httpd
 1168  ?      13     57   204   772   976     0   976   776     0  88  \_ httpd
  214  ?      15     95   204   780   984     0   984   760     0  90  \_ httpd
  171  ?      28    747   160  1956  2116     0  2116   468     0 412 named

Notice there is nowhere near 98 MB ram in use.  So whats using the rest of the memory?  I don't have any ramdisks mounted, and no ramdisks initialized in the kernel.  Shouldn't bdflush kick in and clear this (it never does)?  How can I get more efficient memory usage?  How can I clear the memory without resetting the box?

Mike Crist
mike@mwaz.com  
LVL 1
MikeCristAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

n3mtrCommented:
What does the free program tell you?
Its prabably being used for a disk cache, and resetting would actually hurt your performance.
0
ahoffmannCommented:
What do mean by:
> .. all of the memory is in use.
and later:
> Notice there is nowhere near 98 MB ram in use.

Have you checked in /var/log/boot.msg if the kernel detecet your 98Mb RAM?
0
sauronCommented:
What you're saying is that the sum of memory used by your processes is nowhere near your 96Megs of RAM. When you have loads of spare memory, any disk read gets read into the disk cache. The disk cache will keep on growing as long as there is free memory, and will shrink when a process requests a memory block from the system. The free command should show that most of your memory is in use for cache. This is a good thing - all your memory is being used to enhance system performance.

Things like this are only bad if they cause swapping - MS products are awful at this, they swap like crazy, and performance sucks. Linux won't swap unless you push it, but it will fill up all available memory with cache. Also, the kernel doesn't usually see memory above 64 Megs, the total memory shown in the output from free will show you how much memory the kernel has. You may well need to add a 'mem=96M' parameter to your lilo.conf, or loadlin command line.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MikeCristAuthor Commented:
I didn't know that the memory was already allocated to cache.  Yes, I do have the MEM statement in lilo.conf,  and free shows something like:
             total       used       free     shared    buffers     cached
Mem:         95392      93908       1484      16112      57996      19324
-/+ buffers:            16588      78804
Swap:        24092          0      24092

So memory will be allocated to programs and from cache as needed?

Mike Crist
mike@mwaz.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.