Solved

Linux Memory Status

Posted on 2011-02-11
10
1,194 Views
Last Modified: 2012-05-11
hi Experts,

I have a HP blade server (BL680)  running Redhat Linux with 135.527Gb of RAM. We use the server for processing our CDRs data. At the moment, the server is consuming all the 135Gb RAM! and we can't find out which process his hogging all this memory.

Kindly how we can find out which processes is/are ALL consuming the memory.

I have attached the output of the following commands.
1. uname -mrsn
2. free -g
3. vmstat -m
4. vmstat -a




Linux TZDARHQ-CDR02 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:31:30 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux cdr-memory.txt
0
Comment
Question by:Seni
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Hi,

try

ps -e -o vsz,rss,pid,args

This will show you on a per-process basis the

- total memory size of the process
- resident memory size
- process id
- the process name and arguments

Sort e.g. by virtual memory size with

ps -e -o vsz,rss,pid,args | sort -n -k1

wmp


0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Since Oracle keeps its SGA in shared memory you should additionally check with:

ipcs -m

The size is shown in the "bytes" column.

Get the owning pid and other details of a given segment with

ipcs -m -i shmid

where shmid is to be taken from the column with that name shown by ipcs -m

0
 
LVL 6

Expert Comment

by:Ferrosti
Comment Utility
Have a look at your 'free -g' output.
Everything is OK!

Linux will always use every bit of RAM ever assigned and it will only release it if another program requires new RAM and there is none left.
Your 'free' output shows that there is no swap in use, which is good, and the most important line is the one about '-/+ buffers cache' where it says there is 121GB of free RAM that can be released for new RAM requests.
The only thing that seems to have happened is that your machine is running for so long with program requesting RAM, that it ran full by the time, but it never needed all its RAM at once. And this is the important fact.

vmstat shows no page swapping, so there really is nothing to be concerned about.
0
 
LVL 1

Expert Comment

by:sudhirgoogle
Comment Utility
Its very simple using top command. Simply type 'top' in the shell and hit enter.

By default top command displays the processes in the order of CPU usage.  When the top command is running, press M (upper-case) to display processes sorted by memory usage as shown below.
Top Command Sort By Memory Usage

see the attached sanpshot
top-memory-sort.png
0
 
LVL 8

Expert Comment

by:point_pleasant
Comment Utility
top is the way to go
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:maques
Comment Utility
htop is an even better friend :-)
http://htop.sourceforge.net/
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
Actually memory is not used by application, but it is used for disk caching.
If memory is not fully utilized by kernel than it is wasted, by keeping data in cache it reduces disk I/O and when an application needs data again it can be provided faster from the RAM. If an application demands memory the kernel will release memory according to the need.

If you want to see the memory from the perspective of application you should look at +- buffers/cache line, the free column of this line shows you the memory that can be used for applications.

In the case below my application is using 2GB of memory.

# free -m
total used free shared buffers cached
Mem: 7973 7323 650 0 128 5152
-/+ buffers/cache: 2042 5931
Swap: 8189 40 8149
0
 
LVL 6

Accepted Solution

by:
Ferrosti earned 500 total points
Comment Utility
Once again:
top and htop are not an option, since they show mem usage INCLUDING caches and buffers. The only way to go is using 'free' and having a look at the buffers/cache line or possibly by using vmstat and watch the servers swapping activity. Since the OP posted these logs it is quite clear that he´s got more than enough RAM for what he is doing ATM.
0
 
LVL 9

Expert Comment

by:expert_tanmay
Comment Utility
I concur with Ferrosti. I do stress testing of applications with Oracle on Linux. I need to find the pressure on the system by putting virtual load. The only way of finding RAM usage is free. I also use iostat to get CPU usage, i/o wait etc. You may cat /proc/meminfo and look for the line Cached: and SwapCached:, these are cached space in RAM used by the kernel to reduce disk i/o.

Cheers..
0
 

Author Closing Comment

by:Seni
Comment Utility
still analyzing the output
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn about cloud computing and its benefits for small business owners.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now