How to solve the problem of Linux system Swap exhaustion

  
                

In the process of using Linux, we sometimes encounter the exhaustion of swap memory swap. In the face of this problem, how can we solve it? Now Xiaobian will share the solution to this problem with everyone.

Solution:

1. When the application is started, the memory is insufficient. Directly view the Linux command line. Swap used100%, 0free.

2, reboot the server can effectively release the swap, but in many cases can not restart the server. At this time, we must figure out what is occupying the memory. Look at the contents of the /proc directory, find a lot of digitally named directories, these are the Linux process.

3, let the process method releases the swap only kill off the process. Write a script to see which processes are in memory.

First, traversing all directories named by numbers in the /proc directory

Second, the 1 directory is the root process restart will cause the system to restart, so directly excluded.

Third, each process calculates a memory size, and then sorted by size

Fourth, the process output is greater than 1MB of memory usage

at 12 Previous One page total 2 pages

Copyright © Windows knowledge All Rights Reserved