how to free up ram on RHEL

Besides the obvious of upgrading RAM. is there a way to free up memory on RHEL 5 . As you see below we are maxed out

Tasks: 191 total,   1 running, 190 sleeping,   0 stopped,   0 zombie
Cpu(s): 49.2%us,  9.0%sy,  0.0%ni, 39.3%id,  1.5%wa,  0.1%hi,  0.9%si,  0.0%st
Mem:  16312904k total, 16260260k used,    52644k free,    22988k buffers
Swap: 18481144k total,        0k used, 18481144k free,  9246296k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 4855 ehsj      18   0 7186m 6.2g  10m S 409.6 40.1 110:35.36 java              
 4516 qpidd     16   0  487m  15m 3672 S 58.7  0.1  34:15.33 qpidd              
  808 root      10  -5     0    0    0 S  1.0  0.0   0:15.45 kjournald          
  464 root      15   0     0    0    0 S  0.3  0.0   0:03.67 pdflush            
  465 root      15   0     0    0    0 S  0.3  0.0   0:05.21 pdflush            
  466 root      10  -5     0    0    0 S  0.3  0.0   0:01.73 kswapd0            
 5066 ehsj      15   0 12740 1164  824 R  0.3  0.0   0:00.22 top                
    1 root      15   0 10348  708  592 S  0.0  0.0   0:02.39 init              
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.01 migration/0        
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0        
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/1        
    6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1        
    7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1        
    8 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/2        
    9 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/2        
   10 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/2  
TALYOFFEAsked:
Who is Participating?
 
SuperdaveCommented:
I meant 16GiB not MB.  So you have 6,888 MiB free (about 6.7 GiB).
0
 
SuperdaveCommented:
I wouldn't say you're maxed out.  You're not even touching swap.  Java is the obvious culprit, in my opinion it's bloated and slow but you must be running it for a reason so that decision's already been made.  What performance problems are you having, if any?
0
 
TALYOFFEAuthor Commented:



i was looking at this line  16312904k total, 16260260k used and thought we were using nearly all of the 16 gigs of memory. Is upgrading to 32 gig recommended?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
SuperdaveCommented:
If it ain't broke, don't fix it.  I'm already in awe of a machine that has 16GiB.  My guess would be you don't need it (won't notice much improvement if you get it), especially as you're not even touching swap.  The memory usage includes file-backed pages it hasn't looked at in a long time. It will reclaim that memory when it needs it, and you won't notice any slowdown.
0
 
Monis MontherSystem ArchitectCommented:
My guess you are not using more than 5-6GB

Please post the output of the following command

free -m

0
 
TALYOFFEAuthor Commented:
            total       used       free     shared    buffers     cached
Mem:         15930      15876         54          0         20       8967
-/+ buffers/cache:       6888       9042
Swap:        18047          0      18047
0
 
TALYOFFEAuthor Commented:
doesnt the above show used 15876 and only 54kb of free memory. looks like the alignment is off after i copied and paste
0
 
SuperdaveCommented:
Those figures are in MiB, so your total of 15930 is about 16MB. The "used" number on the second line (that excludes buffers/caches) is what is in use, if you ignore that cached pages that can be dropped if your applications need more memory.  You don't really want much actual free memory, it would just be a waste, so they're filled with cached data most of which you probably don't need.
0
 
Monis MontherSystem ArchitectCommented:
You have almost 9GB of free memory

The Line

-/+ buffers/cache:       6888       9042  

Means you have 6.8 GB used and 9GB free

You are all fine , to understand this exactly read about ( buffer cache ) this is a concept in the Linux kernel that makes use of unused memory instead of leaving it wasted
0
 
SuperdaveCommented:
Technicality: 6,888 mebibytes free is about 6.7 gibibytes or 7.2 gigabytes, and not 6.8 anything.
0
 
Monis MontherSystem ArchitectCommented:
Yup that is more accurate , I was just giving approximates
0
 
stevaleeleeCommented:
Linux handles memory management differently.  Everything is cached to speed access if the same data is used twice.  This memory is instantly available to any process that might need it.  Freemem on an active system will almost always be about 50MB.  This then means that the cached value reported by top or free is the actual amount of free memory.  

With many later Linux distros there is a graphical display that shows the cached mem as part of the free - but it's not very useful for administration unless you have lots of time to sit and watch it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.