Linux killing thread

  Work often appears out of memory and so on when to restart the environment, often need help killing the process to restart successfully, the following detailed instructions on killing the thread to do the next summary:

 
1. Find the need to kill off the thread:

ps -elf | grep critical information [thread]   

For example: ps -elf | grep java
Find all threads such JAVA
For example, to delete tomcat thread, you can do: ps -elf | grep tomcat
So that you can find all the threads associated with the tomcat, you need to kill to find out thread ID

 
2. Force terminate the thread:

Thread kill -9 [ID]
 
For example, your thread ID is 5645646, you can execute: kill -9 5645646

 
3. Confirm whether the thread has been deleted:

ps -elf | grep tomcat or ps -elf | grep java

Guess you like

Origin www.cnblogs.com/renzmin/p/12108187.html