Memory Issue
top command
# top
up 1:09, 3 user, load average: 0.36, 0.12, 0.11
Tasks: 228 total, 1 running, 227 sleeping, 0 stopped, 0 zombie
Cpu(s): 3.7% us, 1.9 sy, 1.2 ni, 91.8 id, 1.3 wa, 0.0 hi, 0.1 si, 0.0 st
Memory(MB): 32092 total, 321 free, 31483 used, 287 buff/cache
Swap(MB): 1024 total, 0.0 free, 1024 used. 200 avail Mem
//All processes Running on System
pid user pr(priority) ni(nice) virt res shr(SharedMem) State %cpu %mem time command
7801 root 20 0 59.6g 26.5g 3224 R 15 84.2 4:36.47 sssd
-
Show output Sorted by Processes that uses CPU most.
up: System up time, Logged in users, CPU load Average(1/5/15 min)[SIMILAR to uptime command]
CPU(s): us(CPU used by User processes), sy(System processes)
Memory(KB): Utilization Status. 2029876=Total system mem. [SIMILAR to free command]
VIRT(Virtual Memory): RAM(RES)+SWAP(Paged out to disk)+Shared_libs
High VIRT is not problem, process reserved lot of address space for itself.
RES(Resident Memory): sssd using 26.5GB Out of 32GB of RAM
htop command
# htop //Similar to top with more colourful, more graphic interface which gives you more control of display scrolling
# ps //Reports snapshot of current processes. //ps -aux a:Displays all processes on a terminal. u: Show user-name, x; Lists all process(Including background processes)
user pid %cpu %mem vsz rss tty state start-time command
root 1 0.0 0.1 19404 832 ? Ss Mar02 0:01 /sbin/init
root 2 78.0 0.0 0 0 ? S Mar02 0:00 [abc]
root 3 0.0 0.0 0 0 ? S Mar02 0:00 [migration/0]
States of process: D(uninterruptible sleep), R(Running), S(Interruptible sleep), T(stopped by job control signal), t(stopped by debugger during the tracing), X(dead), Z(defunct/Zombie process, terminated but not reaped by its parent)
df command
# df -h //Disk Free, Shows local and network file system
Filesystem Size Used Avail Use% Mounted on
/dev/map/root 11G 3.8G 6.0G 39% / // root file system mounted on "/" has only 6.0G available
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 1.6M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /tmp
| file system | Description |
|---|---|
| /dev/sdd | Real physical block device(Hard Disk). Mounted on root filesystem (/) |
| tmpfs | temporary file system that resides on volatile memory(RAM). Data is lost when system reboots. Includes /run etc |
| tmpfs | temporary file system that resides on volatile memory(RAM). Data is lost when system reboots. Includes /run etc |
| shm (shared memory) | tmpfs mounts for shared memory only. |
atop output
-
Commands:
Open existing file using `atop -r file_name`
Press M for memory view, C for CPU view
s for scheduling activity
t for next sample taken after 10 min
atop
MEM | tot 32G | free 860.4M | cache 6.3G // 6.3G still left to be used
SWP | tot 1G | free 590M | swcac 16.3M
Press C
PID VGROW RGROW CPU CMD
xx 45.0G 17.8G 30% npraxy
Press M
PID VDATA VSIZE RSIZE VGROW RGROW SWAPZ MEM CMD
xx 44.3G 45.0G 17.8G 45.05G 17.8G 92.4M 57% npraxy
VDATA: size of private process memory (heap and data sections) that is not shared and is part of the virtual address space
SWAPZ: size of the swap space currently used by a process
VGROW (Virtual Memory Growth): amount by which a process’s virtual memory size (VSIZE) has increased ("grown") during the monitoring interval.
RGROW: Increase ("growth") in the resident memory of process. How much additional RAM process has used since last monitoring time
RSIZE (Resident Size):Total resident memory used by a process, Resident memory is the portion of a process's memory that is actually held in physical RAM
PSIZE(Physical Size): physical memory size occupied by the process
swcac(Swap Cache): Cache which is holding the pages.