Check memory cpu consumption on linux

quote


df -hl

https://segmentfault.com/q/1010000004917953/a-1020000004918775


Common /dev/mapper/centos-root expansion

system Centos 7

df -h View current partition usage;
dfisk /dev/xvda to /dev/xvda Disk operation (new partition and format)
n
p
Enter the default partition number;
Enter the default disk creation start position;
Enter the default disk creation end position;
t Set the partition type
8e LVM type
w Save
Restart
lvm and enter lvm management
lvm> pvcreate /dev/sda3 Create logical volume
lvm>vgextend centos /dev/sda3 //Add the initialized partition to the virtual volume group centos
lvm>vgdisplay -v
lvm>lvextend -l+1298 /dev/mapper/centos-root
lvm >pvdisplay //View volume capacity
lvm>quit  
Use the command xfs_growfs /dev/mapper/centos-root to expand the capacity.
df -h to view after expansion




top

https://www.cnblogs.com/xuxm2007/archive/2012/06/05/2536294.html


Top command monitors the resource occupancy of a process The following are various types of memory: VIRT: virtual memory usage
1. The process "requires 2. If a process applies for 100m of memory
, but actually only uses 10m, it will increase by 100m instead of the actual usage
RES: resident memory usage often Resident memory
1. The size of the memory currently used by the process, but does not include swap out
2. It includes the sharing of other processes
3. If you apply for 100m of memory and actually use 10m, it only increases by 10m, which is opposite to VIRT
4. About the memory occupied by the library In this case, it only counts the memory size of the loaded library files
SHR: shared memory
1. In addition to the shared memory of its own process, it also includes the shared memory of other processes
2. Although the process only uses a few shared library functions, it contains Calculate the size of the entire shared library
3. Calculate the physical memory size formula occupied by a process: RES – SHR
4. After swap out, it will drop the memory occupied by DATA1 and data. If top is not displayed, press the f key to display it.
2. The real data space required by the program is really to be used in operation






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326072792&siteId=291194637