Link to home
Start Free TrialLog in
Avatar of Seni
Seni

asked on

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
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

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


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

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.
Avatar of sudhirgoogle
sudhirgoogle

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
top is the way to go
htop is an even better friend :-)
http://htop.sourceforge.net/
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
ASKER CERTIFIED SOLUTION
Avatar of Ferrosti
Ferrosti
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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..
Avatar of Seni

ASKER

still analyzing the output