Recently on-line module, always inexplicably to kill the server, execute any command on the server always reported-bash:fork:cannot allocate memory
After waiting for a while, even SSH will not be able to proceed, the following two commands, you can view the current machine CPU, MEM top:
# The Linux fetch process consumes the highest CPU top 10 processes PS Aux|head-1;ps aux|grep-v pid|sort-rn-k +3|head
# Linux down process takes up memory (MEM) The top 10 processes PS Aux|head-1;ps aux|grep-v pid|sort-rn-k +4|head
PS aux detailed:
# PS aux|head-1 #显示ps aux execution First line USER PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND
The vsz indicates how much memory space is required if a program resides completely in memory; RSS indicates how much memory is currently in use; Stat shows the current status of the process: D non-interruptible uninterruptible (usually IO) R is running, or the process in the queue S is in hibernation T stop or is traced Z zombie process W enters memory swap (from kernel 2.6 Start invalid) X dead process
1) PS A shows all the programs under the current terminal, including other users ' programs. 2) ps-a Show All Programs. 3) PS C lists the program, displays the actual instruction name of each program, and does not include the path, parameter or the indication of the resident service. 4) Ps-e The effect of this parameter is the same as specifying the "A" parameter. 5) When listing the program, PS e displays the environment variables used by each program. 6) PS F Displays the tree structure with ASCII characters, expressing the relationship between the programs. 7) ps-h shows the tree structure, indicating the relationship between the programs. 8) Ps-n shows all the programs except the program under the PS Command Terminal. 9) PS s uses the program signal format to display the program status. PS S when listing programs, including interrupted sub-program data. Ps-t < terminal number > Specify the terminal number and list the status of the program belonging to the terminal. PS U Displays the status of the program in a user-oriented format. PS x Displays all programs and does not differentiate by terminal.
Ps-l a longer, more detailed display of the PID information
Linux PS aux explained in detail