LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-11-2012, 01:14 PM   #1
redhat70
Member
 
Registered: May 2012
Posts: 86

Rep: Reputation: Disabled
Memory issue on Linux server.


Hi,

We have a memory issue on Linux server.

When I used top command to check the memory, it shows:

top - 18:58:55 up 78 days, 5:25, 2 users, load average: 9.97, 7.52, 5.74
Tasks: 2578 total, 3 running, 2575 sleeping, 0 stopped, 0 zombie
Cpu(s): 14.4%us, 2.2%sy, 0.0%ni, 61.9%id, 20.8%wa, 0.1%hi, 0.6%si, 0.0%st
Mem: 49432916k total, 47305400k used, 2127516k free, 518164k buffers
Swap: 16777208k total, 0k used, 16777208k free, 4960840k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
31966 root 16 0 14652 3032 808 R 2.3 0.0 0:00.96 top
7062 oracle 16 0 9875m 22m 18m S 1.3 0.0 48:08.34 oracle
7177 oracle 16 0 9875m 25m 21m S 1.3 0.1 44:31.37 oracle
7350 oracle 15 0 9874m 21m 17m S 1.3 0.0 44:36.29 oracle
7773 oracle 15 0 9875m 26m 21m S 1.3 0.1 48:08.23 oracle
8140 oracle 15 0 9875m 26m 21m S 1.3 0.1 44:23.34 oracle
8193 oracle 15 0 9874m 21m 17m S 1.3 0.0 47:48.87 oracle
5296 oracle 16 0 9921m 63m 21m D 1.0 0.1 29:03.85 oracle

Mem : 49432916k total
Used : 47305400k

AND

# free –g shows:

[root@dillion ~]# free -g
total used free shared buffers cached
Mem: 57 55 3 0 0 5
-/+ buffers/cache: 49 8
Swap: 16 0 16


None of the oracle instances are using more memory.

Then what could be the problem ?

Why the memory is showing 55 used out of 57GB ?

Can anybody help me in this issue ?


Regards,
Aparna.
 
Old 10-11-2012, 01:25 PM   #2
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
I don't understand the question ...

Are you questioning why most of your memory is being used?! That's normal...

Memory management in Linux works different than in Windows...
 
Old 10-11-2012, 01:47 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by JaseP View Post
Are you questioning why most of your memory is being used?! That's normal.
No. I'm pretty sure it is not normal.

Take a closer look at the numbers:

Quote:
Originally Posted by redhat70 View Post
49432916k total,
...
4960840k cached
Cached is just over a tenth of total while buffers is much smaller.

Swap is available but unused indicating not much memory pressure (or maybe indicating someone messed with the swappiness to create this odd situation). But a system with that much ram and just a tenth as cache (with little free) implies significant memory pressure.

Last edited by johnsfine; 10-11-2012 at 01:50 PM.
 
Old 10-11-2012, 02:10 PM   #4
redhat70
Member
 
Registered: May 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
what johns-fine says is right ..

something is messing up with the memory.

but how to find it out ?
 
Old 10-11-2012, 02:24 PM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I've never heard of anyone allocating 50GB to a VM, but it doesn't hurt to ask: Is this running on a physical machine or a VM? (VM's often do strange things to available memory).

Next you could try
Code:
cat /proc/slabinfo
to see if anything is strange in kernel memory use.

Also
Code:
cat /proc/meminfo

Last edited by johnsfine; 10-11-2012 at 02:26 PM.
 
Old 10-11-2012, 11:48 PM   #6
James259
LQ Newbie
 
Registered: Sep 2010
Posts: 18

Rep: Reputation: 0
Hi,

I am no expert but I have seen this before.

A while back I was working on a C program with a big loop in it and I was careless with my memory management.
In my loop memory was getting allocated, but not freed before going out of scope.

This created the exact same thing in top. Lots of memory that seemed to be allocated somewhere, not in cache or buffers - just used.
Looking down all processes running did not add up anywhere even close to the amount of memory it said was used.

Killing my program (which was an infinite loop) did return my several gigs of missing memory - even though top only said it was using a few meg.

Maybe, if you can, kill any tasks that you know and restart them. Keep an eye on top while you do it.
If its a memory leak like that then you will possibly get memory back suddenly and then it will slowly drain away again.

Sorry if I am off the mark experts. :P Just something I saw once that might be relevant.

James
 
Old 10-13-2012, 11:52 AM   #7
farnsy
LQ Newbie
 
Registered: Nov 2008
Location: Pennsylvania
Distribution: Fedora 19
Posts: 24

Rep: Reputation: 2
Be sure to check the easy things. Your top output does not indicate that you ordered by memory usage. If you haven't already, you might want to do that and see if you get better results. There might be some process way down where you don't see it that is sucking memory.

Within top type 'O' (that's the letter oh), which brings up a list of items you can sort by. Then "n" to order by resident memory usage. Or select "p" or "o" or "q". There are several options you might look at. Might as well be thorough while you are using top to investigate memory usage.

Last edited by farnsy; 10-13-2012 at 11:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
memory issue in RHEL4 Server rcm Linux - Server 5 01-14-2009 12:13 AM
Inactive memory issue, Freebsd (memory leak?) JasperB *BSD 7 08-12-2008 03:19 AM
red5 (flash server) build memory issue kurupt Linux - Server 1 09-25-2007 10:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration