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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

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).

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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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.
Duncan RoeSoftware DeveloperCommented:
Your posted output from free shows only 27G actually used (line 3). Line 4 shows no swapping. The 2 together show a system running well with no memory issues.
Don't worry about cache - its only purpose is to save physical accesses to file system devices.
nociSoftware EngineerCommented:
HM. Points should be split, as at least 3 answers say that memory is not the problem...
Duncan RoeSoftware DeveloperCommented:
@noci: I can't see any other answers saying that memory is not the problem. Can you identify those you have in mind please?
nociSoftware EngineerCommented:
Why clean caches....

#42493088  - on 2nd reading, less relevant....

Your posted output...

OK 2 not 3.
Duncan RoeSoftware DeveloperCommented:
OK I would include https:#a42492300 next time. But it did not ram home the point that memory is not a problem on this system and all memory in use is perfectly normal, so uneven points split.
BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
Sorry guys .. yes it is solved...we have rebooted after stop starting the application ;)
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

From novice to tech pro — start learning today.