Linux memory issue and let me know how can i fix this?

I can see all processes in my box using memory total as 25GB but the actual memory used is 62GB, I am really confused that what happened for remaining memory....don't know whether i need to clear memory cache or not?

test@test[~] $  ps aux  | awk '{print $6/1024/1024 " GB\t\t" $11}'  | sort -nr | awk '{print $1}' | awk '{total = total + $1}END{print total " GB"}'
24.4622 GB
test@test[~] $ free -g
                            total       used       free     shared    buffers     cached
Mem:                      62         62          0          0               2             32
-/+ buffers/cache:              27         35
Swap:                        7          0          7
test@test[~] $

Open in new window

memory issue
BharathKumarRaju DasaraRajuDevops EngineerAsked:
Who is Participating?
Syed Abdul QadeerSenior Linux AdministratorCommented:
try clearing cache memory
nociSoftware EngineerCommented:
Why clean caches...., in caches the data is left in IO buffers, just in case it could be reread later on.
Buffers should get flushed if more processes are started, ie. memory for processes is needed.
The OS should do that for you.

Are you running into trouble?...
Effectively this means ALL of your memory is used, either by processes or by IO caches.
So you didn't buy too much of the memory.

Clearing caches just means that all cache information is dumped, and the counter should show that,
all IO will fill the cache again..., at the expense of Physical IO to storage.
This might actualy slow down your systems as they incur more delays to get the same job done.
It might also be a sign that this environment may need MORE memory to function optimal. (that would happen if processes get swapped).
BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
Hi Guys,

Thanks for your reply. But now my application is down because any suggestion to reduce memory in this box please
not sure what, your system is swapping.
The scheduler designates which process runs while those that are not are stored on disk until their turn.

Top is the command to use, see utilization
Uptime is another to see load.
Vmstat 5 5
Iostat -xtc 5 5

What is your application?
You may have to make sure your applications are tuned.

If your memory demand is twice what you have it suggests the system was under speced for what it needs.

I.e. You rented a utility truck but what you need to move needs a moving truck.
Underestimated the load on the system.
Dr. KlahnPrincipal Software EngineerCommented:
As arnold says.

But I would have said, "You have a half-ton pickup but you need a Missile Crawler Transporter Facility."  An application that requires 25 GB of physical memory and then uses another 30 GB of cache wants either (a) strong re-evaluation by an analyst in that area with an eye toward streamlining, or (b) splitting up across multiple systems.

Side issue:  Cache is great, but imo there can be too much of it.  When a system with a great big cache fails, there can be so much uncommitted data in the cache (and 30 GB is a lot of uncommitted data) that "things" wind up corrupt, particularly databases.  30 GB of cache is a lot of cache; imo, too much.  I'd set restrictions on the amount of cache the system can use.

"By default, Linux will use free RAM (almost all of it) to cache disk accesses, and will delay writes. The heuristics used by the kernel to decide the caching strategy are not perfect, but beating them in a specific situation is not easy."

On a non-journaling file system the result might be disaster.
All Courses

From novice to tech pro — start learning today.