Linux Memory Status

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
SeniAsked:
Who is Participating?
 
FerrostiCommented:
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
 
woolmilkporcCommented:
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
 
woolmilkporcCommented:
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
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
FerrostiCommented:
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
 
sudhirgoogleCommented:
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
 
point_pleasantCommented:
top is the way to go
0
 
maquesCommented:
htop is an even better friend :-)
http://htop.sourceforge.net/
0
 
expert_tanmayCommented:
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
 
expert_tanmayCommented:
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
 
SeniAuthor Commented:
still analyzing the output
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.