For example, to kill processes consuming more than 100 MB memory, we can run the below command. When I run sudo kill -9 with the proper process ID, the process stops but then is restarted and has a new PID. Don’t worry about getting the exact name of the process, either. ps -A |grep java output of this command will give the list of java processes running on your system. Try to kill process using kill -9 28631 and you should see new process should be created. But top does not identify the state of any process, so I can't tell which one is stuck.
Some cases you might want to kill all the process running in a specific port. Note: To uninstall Java, you must have Administrator privileges and execute the remove command either as root or by using the sudo tool. ps -ax | grep Skype yields the same result.
In Terminal, type man top to see the various options. Kill processes consuming high amount of memory. Also, Ctrl + Z might help if you want to suspend a process. This command killed a process named ssh-agent that was running on our system. You wrote down “The name “java” doesn’t tell you anything, to get the detail, ps the java PID 12895 like this :” If your macOS version is 10. These are 833, 860, and 861 in our example above.
Kill java process mac terminal 4 of startup errors.