Operating System - Linux
1828344 Members
3071 Online
109976 Solutions
New Discussion

Re: How to see the memory usage for each process

 
SOLVED
Go to solution
Binu_5
Regular Advisor

How to see the memory usage for each process

HI All

How can see the mememory usage used by each process ...
The problem Iam facing here is
the memeory is been used completly by some process Though the useres who has holding the memory has been logged out.
And also though the memory is used 100 % the
swap memory usage is only 1%

How can I make use of this swap memory

OS version is Red hat LInux 9

Thanks
Binu
5 REPLIES 5
VEL_1
Valued Contributor

Re: How to see the memory usage for each process

Hi,

Refer this link:

http://rimuhosting.com/howto/memory.jsp

It has useful info for "Troubleshooting Memory Usage"
Gopi Sekar
Honored Contributor
Solution

Re: How to see the memory usage for each process


you can get the memory information through 'top' command or 'ps' command with proper options.

If a process is died the memory is not immediately cleared and set as free (for performance), instead it will be set as unclaimed and any new process requiring memory will be allocated from this junk. so as such the used and free memory available is not true reflection of memory consumed.

swap memory is used only incase RAM memory runs out and there is no RAM available for new process. using swap memory affects the system performance very badly, if a system does a lot of swapping then it means RAM is not enough and requires RAM upgrade. In your case you should be happy that swap is only 1% used which means you have enough RAM to run all process.

Hope this helps,
Gopi
Never Never Never Giveup
Roderik Hamers
Frequent Advisor

Re: How to see the memory usage for each process

Binu,

The command to see the memory usage of each progress is "ps -aux"
Binu_5
Regular Advisor

Re: How to see the memory usage for each process

Hi

The below mentioned values are changing after the reboot...
Which are the file we should specify the
config other than /etc/sysctl


------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 524288
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 2000
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 1024
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

Also ps -aux doesnt show much memory utilisation
But if we use free command to check the memory usage it ishowing the full memory is being used .

[root@wiplx15 root]# free
total used free shared buffers cached
Mem: 3476884 3465252 11632 0 113120 3034912
-/+ buffers/cache: 317220 3159664
Swap: 8393952 88196 8305756

How to flush the unused memory

Thanks
Binu
Gopi Sekar
Honored Contributor

Re: How to see the memory usage for each process


/etc/sysctl.conf is the easy way to have the values permanent in proc filesystem.

There are different key values used for setting up each of your requirements (semaphore, sharedmemory). All these keys are available in /proc/sys/kernel directory.

For ex: shmmax refers to maximum shared memory available to kernel, to set this value permanent then add a line to /etc/sysctl.conf like:
kernel.shmmax=

Read kernel documentation to find key names for each of your requirement.

Another way is to directly updating proc file system from /etc/rc.local
eg:
echo > /proc/sys/kernel/shmmax

add the above line to /etc/rc.local file, this file get called everytime system boots up thus effectively modifying the values as required.

But word of warning, /etc/rc.local file is called only at the end of system start up (i.e. after all processes are started). if a process requires these updated values before they start, then make sure the process gets launched only from /etc/rc.local after all proc system modification is done. Hope I am clear in explaining this!

/etc/sysctl.conf is called during first phase of system startup before any process are started, so sysctl is the ideal place to put these values in.

Hope this helps,
Gopi


Never Never Never Giveup