Memory ,cpu, Hard disk difference

Memory : Is where programs and data are stored , For example, when we are using WPS When processing a document , When you type a character on the keyboard , It is stored in memory , When you choose to save , The data in the memory will be stored in the hard disk ( magnetism ) disc . After power failure , All information in memory is lost , The storage medium is an integrated block RAM type , Electronic reading and writing , Small storage capacity ..

cpu: It's English “Central Processing
Unit/ Central Processing Unit ” Abbreviation of ,CPU Generally, it is composed of logical operation unit , Control unit and storage unit . Some registers are included in the logic operation and control unit , These registers are used for CPU Temporary storage of data during data processing ,
Actually, we're buying CPU Time , You don't need to know its structure , Just know its performance .

Hard disk : Magnetic storage , Read and write by magnetic head . The hard disk can store data for a long time , Never break the sound of the movie . Large storage capacity .

one .linux System view memory command :cat /proc/meminfo

free Command is a quick way to view memory usage , It's right /proc/meminfo An overview of the information collected

How to judge whether the system memory is insufficient : If Swap used Value greater than 0, Represents that the physical memory of the server has encountered a memory bottleneck , Virtual memory used , Or optimize the code , Or add memory

1. Memory

total: Total memory

used: Memory used

   free: Free memory

shared: Currently abandoned

buffers: Buffer allocated by the system but not used

cached: Cache allocated by the system but not used

(buffers and cached difference :A buffer is something that has yet to be “written” to disk.
A cache is something that has been “read” from the disk and stored for later
use( The buffer has not been written to disk . Cache is from disk “ read ” And stored for future use ))

2.  Memory used by program :

-(buffers/cached):used Part I mem that 's ok used-buffers-cached ( Memory that is actually eaten by the program )

Program free memory

+(buffers/cached):free Part I mem that 's ok free+buffers+cached ( Total amount of memory that can be misappropriated )

3. Exchange area

two .cpu:top( You can view it cpu You can also view the memory usage 1.)

Use the contents of the red box in the picture below to determine whether the system load is too high ( Same order uptime Display effect )

: Server running time

task

Judge the running state :s:sleep;  r:run; Z: corpse ( representative : The process is dead , But it's still occupying the process , Server resource not released )

i: Represents switching resources for a short time

 

three . Display disk :df -h

four . View server java program

ps -ef|grep java

five :linux system state

 

 

 

 

 

Technology
Daily Recommendation