LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Memory issue on Linux server. (https://www.linuxquestions.org/questions/linux-server-73/memory-issue-on-linux-server-4175431713/)

redhat70 10-11-2012 01:14 PM

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.

JaseP 10-11-2012 01:25 PM

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

johnsfine 10-11-2012 01:47 PM

Quote:

Originally Posted by JaseP (Post 4803247)
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 (Post 4803237)
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.

redhat70 10-11-2012 02:10 PM

what johns-fine says is right ..

something is messing up with the memory.

but how to find it out ?

johnsfine 10-11-2012 02:24 PM

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

James259 10-11-2012 11:48 PM

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

farnsy 10-13-2012 11:52 AM

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.


All times are GMT -5. The time now is 12:46 PM.