Visit The New, Modern Unix Linux Community

High RAM usage, extremely low swapping

Thread Tools Search this Thread
Operating Systems Linux Red Hat High RAM usage, extremely low swapping
# 1  
High RAM usage, extremely low swapping

Hi team

I have three physical servers running on Red Hat Enterprise Linux Server release 6.2 with the following memory conditions:

# cat /proc/meminfo | grep -i mem
MemTotal:        8062888 kB
MemFree:          184540 kB
Shmem:               516 kB

and the following swap conditions:

# cat /proc/meminfo | grep -i swap
SwapCached:          688 kB
SwapTotal:      10305528 kB
SwapFree:       10302584 kB

# cat /proc/sys/vm/swappiness

# swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       10305528        2944    -1

As you can see the swapspace is double the size of memory and yet the swap usage is relatively low compared to actual memory usage:

# free -mt
                     total       used       free     shared    buffers     cached
Mem:          7873       7693        179          0        380       4241
-/+ buffers/cache:       3071       4802
Swap:        10063          2      10061
Total:       17937       7696      10241

I am trying to understand why the processes are not using swap instead, but relying on RAM until it reached a critical level of 97% last weekend (sorry, haven't got the numbers all I have are charts from nagios) How can I make the process use swap instead of so much of RAM?

Having an aye-karamba moment here
# 2  
Hi, this is normal Linux behavior. Linux uses free memory for cache and buffers, which is immediately released when it is needed.. Search these forums for more details..
# 3  
Scrutinizer, I did search and found that it's OK for RAM usage to be critically high, but if customer has no issue with high swapping (i know disk access will be slower) wouldn't this be a better option instead?
# 4  
No, in general, it is not a better option. See Help! Linux ate my RAM!
This User Gave Thanks to fpmurphy For This Post:
# 5  
You are having the standard linux newbie memory freakout. We sometimes see a few of these a month. Take a deep breath and relax -- you're not running out of memory.

Memory that's otherwise sitting idle gets used for caches when there's anything to cache, because it's wasted just sitting around doing nothing. The kernel gives it up just as readily as any other unused memory -- you don't need to "free" anything or put your computer through weird convolutions to "release the cache". Everything is fine.

Just consider 'cache' and 'free' to get truer numbers on how much memory is available.
This User Gave Thanks to Corona688 For This Post:
# 6  
This might help you out also:

vmstat -s -S M | egrep 'mem|swap'

Memory is faster than swap. If you have a lot of unused memory, then you are wasting it.
This User Gave Thanks to mark54g For This Post:
# 7  

@corona, thanks that was a relief. I logged a case with RHEL just in case and they told me the same thing you did but in totally incomprehensible terms Smilie

@mark, thanks for the vmstat syntax. I suppose cat /proc/meminfo provided me with more or less the same info

@murphy, I did check the link you provided but I got lost halfway thru Smilie I think I was just too stressed to figure it out yesterday!

Anyways, just in case someone comes across this thread and wants answers, following is the math concoction:

For example (Units are in megabytes):

# free -m
             total       used       free     shared    buffers     cached
Mem:          1000        900        100          0        350        350
-/+ buffers/cache:        200        800

In this example, as far as applications are concerned the system is using only 200MB of memory and has 800MB free and available for use if needed.

Note: in this example,

    Total Physical Memory = 1000 M

    Physically Used Memory = 900 M

    Actual used memory = 200 M

    buffers = 350 M

    cached = 350 M

    Physically Free Memory = 100 M

    Memory free for Applications = 800 M

The items to note here are:

<Physically Used Memory> = <Actual used memory> + <buffers> + <cache> = 200 + 350 + 350 = 900 M

<Physically Free Memory> = <Total Physical Memory> - <Actual used memory> - <buffers> - <cache> = 1000 - 200 - 350 - 350 = 100 M

<Memory free for Applications> = <Total Physical Memory> - <Actual used memory> = 1000 - 200 = 800 M

<Memory used  by Applications> = <Physically Used Memory> - <buffers> - <cache> = 900 - 350 - 350 = 200 M

This User Gave Thanks to hedkandi For This Post:

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #435
Difficulty: Medium
Angular and AngularJS are web application frameworks to use for developing multi-page web applications.
True or False?

9 More Discussions You Might Find Interesting

1. AIX

High Runqueue (R) LOW CPU LOW I/O Low Network Low memory usage

Hello All I have a system running AIX 61 shared uncapped partition (with 11 physical processors, 24 Virtual 72GB of Memory) . The output from NMON, vmstat show a high run queue (60+) for continous periods of time intervals, but NO paging, relatively low I/o (6000) , CPU % is 40, Low network.... (9 Replies)
Discussion started by: IL-Malti
9 Replies

2. UNIX for Dummies Questions & Answers

Kernel/ user space and high/ low mem

Need some clarification on this.... 1. how are kernel/ user spaces and high/low memory related? 2. What do they all mean when i have the kernel command line as: "console=ttyS0,115200 root=/dev/sda2 rw mem=exactmap memmap=1M@0 memmap=96M@1M irqpoll" or 2. what do mem and memmap mean in... (3 Replies)
Discussion started by: dragonpoint
3 Replies

3. UNIX for Advanced & Expert Users

Extremely high kernel CPU Usage (Solaris 10 SPARC)

I've got a domain running on a few boards of a 25k. I'm seeing very high kernel cpu usage in top and cant' quite explain it. System runs a large number of smallish Oracle 10g2 databases (30), used mainly for development. load average: 36.63, 36.68, 37.42 2489 processes: 2452 sleeping, 21... (0 Replies)
Discussion started by: utopiajoe
0 Replies

4. Shell Programming and Scripting

Split file into chunks of low & high byte

Hi guys, i have a question about spliting a binary file into 2 chunks. First chunk with all high bytes and the second one with all low bytes. What unix tools can i use? And how can this be performed? I looked in manpages of split and dd but this does not help. Thanks (2 Replies)
Discussion started by: basta
2 Replies

5. Shell Programming and Scripting

Picking high and low variables in a bash script - possible?

Is it possible to have a bash script pick the highest and lowest values of four variables? I've been googling for this but haven't come up with anything. I have a script that assigns variables ($c0, $c1, $c2, and $c3) based on the coretemps from grep/sed statements of sensors. I'd like to also... (5 Replies)
Discussion started by: graysky
5 Replies

6. Shell Programming and Scripting

low & high values

on the file Ftp'd from the mainframe ,do we have any UNIX command to replace mainframe low and values to space or null. i tried using tr and it doesn't work ... Thanks (1 Reply)
Discussion started by: rlmadhav
1 Replies

7. Solaris

malloc returning NULL if freemem high & swapmem low

Hi All, In my application malloc is returning NULL even though there is sufficient amount of free memory is available but swap memory is low. Is this possible that, if free memory is high & swap memory is low, malloc will not be able to allocate memory & return NULL ?:) Kindly look into... (5 Replies)
Discussion started by: Ritesh Kumar
5 Replies

8. UNIX for Advanced & Expert Users

Sun: High kernel usage & very high load averages

Hi, I am seeing very high kernel usage and very high load averages on my system (Although we are not loading much data to our database). Here is the output of top...does anyone know what i should be looking at? Thanks, Lorraine last pid: 13144; load averages: 22.32, 19.81, 16.78 ... (4 Replies)
Discussion started by: lorrainenineill
4 Replies

9. UNIX for Dummies Questions & Answers

low RAM

Hy, I've an 486 dx2 laptop an I want to run unix on it, the problem is it has only 4 megabytes of ram, so my question is; does anybody know an unix based OS which runs with only 4 mb? thanx (7 Replies)
Discussion started by: counTnegaTive
7 Replies

Featured Tech Videos