Linux: 删除终止的进程
Linux: Removing terminated processes
为什么这些终止的python进程仍然占用内存?
我之前用kill
杀了他们
如何在不重启系统的情况下删除它们?
这是top
的输出
top - 01:48:34 up 5:25, 2 users, load average: 0.18, 0.15, 0.73
Tasks: 282 total, 1 running, 238 sleeping, 43 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.0 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 15483.1 total, 4861.2 free, 9689.3 used, 932.6 buff/cache
MiB Swap: 7971.0 total, 7462.0 free, 509.0 used. 5437.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8516 matthia+ 20 0 89568 9604 8072 S 0.0 0.1 0:00.06 systemd
8523 matthia+ 20 0 323044 2996 16 S 0.0 0.0 0:00.00 (sd-pam)
8538 matthia+ 20 0 507976 8184 6972 S 0.0 0.1 0:00.02 pulseaudio
8588 matthia+ 20 0 76484 5756 5220 S 0.0 0.0 0:00.00 dbus-daemon
8590 matthia+ 20 0 522672 10796 7672 S 0.0 0.1 0:00.00 gvfsd
8595 matthia+ 20 0 379792 8264 7140 S 0.0 0.1 0:00.00 gvfsd-fuse
8852 matthia+ 20 0 163784 5260 4080 S 0.0 0.0 0:00.37 sshd
8855 matthia+ 20 0 235756 4616 3256 S 0.0 0.0 0:00.14 bash
9640 matthia+ 20 0 726992 52484 36644 T 0.0 0.3 0:00.18 python
9661 matthia+ 20 0 953636 254480 19736 T 0.0 1.6 1:27.65 python
9662 matthia+ 20 0 953736 225512 19272 T 0.0 1.4 1:27.68 python
9663 matthia+ 20 0 953768 251920 19736 T 0.0 1.6 1:27.68 python
9664 matthia+ 20 0 953744 236568 19736 T 0.0 1.5 1:27.67 python
9665 matthia+ 20 0 953644 217700 19356 T 0.0 1.4 1:27.66 python
9666 matthia+ 20 0 953600 246592 19736 T 0.0 1.6 1:27.65 python
9693 matthia+ 20 0 726992 274520 36152 T 0.0 1.7 0:00.21 python
9714 matthia+ 20 0 953636 476396 19532 T 0.0 3.0 0:03.29 python
9715 matthia+ 20 0 953736 476328 19436 T 0.0 3.0 0:03.29 python
9716 matthia+ 20 0 953768 476228 19724 T 0.0 3.0 0:03.30 python
9717 matthia+ 20 0 953744 475772 19172 T 0.0 3.0 0:03.29 python
9718 matthia+ 20 0 953644 475728 19252 T 0.0 3.0 0:03.30 python
9719 matthia+ 20 0 953600 476048 19464 T 0.0 3.0 0:03.29 python
9733 matthia+ 20 0 726992 277788 36444 T 0.0 1.8 0:00.21 python
9754 matthia+ 20 0 953624 479008 19684 T 0.0 3.0 2:03.45 python
9755 matthia+ 20 0 953744 479060 19664 T 0.0 3.0 2:03.44 python
9756 matthia+ 20 0 953780 479232 19688 T 0.0 3.0 2:03.39 python
9757 matthia+ 20 0 953744 478560 19464 T 0.0 3.0 2:03.43 python
9758 matthia+ 20 0 953628 478732 19448 T 0.0 3.0 2:03.41 python
9759 matthia+ 20 0 953600 478672 19612 T 0.0 3.0 2:03.42 python
9793 matthia+ 20 0 726992 278024 36296 T 0.0 1.8 0:00.21 python
9814 matthia+ 20 0 953624 471732 19568 T 0.0 3.0 0:10.65 python
9815 matthia+ 20 0 953744 476700 19568 T 0.0 3.0 0:10.67 python
9816 matthia+ 20 0 953780 473304 19568 T 0.0 3.0 0:10.68 python
9817 matthia+ 20 0 953744 478216 19404 T 0.0 3.0 0:10.65 python
9818 matthia+ 20 0 953628 477136 19408 T 0.0 3.0 0:10.65 python
9819 matthia+ 20 0 953600 476736 19568 T 0.0 3.0 0:10.66 python
9861 matthia+ 20 0 726856 282796 37132 T 0.0 1.8 0:00.21 python
9882 matthia+ 20 0 954020 485460 20132 T 0.0 3.1 0:15.55 python
9883 matthia+ 20 0 953972 485428 20000 T 0.0 3.1 0:15.51 python
9884 matthia+ 20 0 953636 485464 20128 T 0.0 3.1 0:15.61 python
9885 matthia+ 20 0 953612 485100 20028 T 0.0 3.1 0:15.59 python
9886 matthia+ 20 0 953492 484860 19952 T 0.0 3.1 0:15.59 python
9887 matthia+ 20 0 953500 484960 20068 T 0.0 3.1 0:15.54 python
9897 matthia+ 20 0 726868 288000 36904 T 0.0 1.8 0:00.19 python
9898 matthia+ 20 0 217080 948 872 T 0.0 0.0 0:00.00 tee
9922 matthia+ 20 0 954020 490580 19516 T 0.0 3.1 0:06.89 python
9923 matthia+ 20 0 953608 490400 19744 T 0.0 3.1 0:06.86 python
9924 matthia+ 20 0 953568 490224 19564 T 0.0 3.1 0:06.83 python
9925 matthia+ 20 0 953612 490228 19564 T 0.0 3.1 0:06.89 python
9926 matthia+ 20 0 953492 490096 19552 T 0.0 3.1 0:06.90 python
9927 matthia+ 20 0 953500 490296 19744 T 0.0 3.1 0:06.88 python
状态T
没有终止,它是“被作业控制信号停止”(man top)。
要使进程进入此状态,您可能已将 SIGSTOP
发送给它们 (kill -STOP ...
)。相反,您应该发送一个 SIGTERM
(默认值),您现在仍然可以这样做。如果这不起作用,请发送 SIGKILL
.
为什么这些终止的python进程仍然占用内存?
我之前用kill
杀了他们
如何在不重启系统的情况下删除它们?
这是top
top - 01:48:34 up 5:25, 2 users, load average: 0.18, 0.15, 0.73
Tasks: 282 total, 1 running, 238 sleeping, 43 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.0 sy, 0.0 ni, 99.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 15483.1 total, 4861.2 free, 9689.3 used, 932.6 buff/cache
MiB Swap: 7971.0 total, 7462.0 free, 509.0 used. 5437.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8516 matthia+ 20 0 89568 9604 8072 S 0.0 0.1 0:00.06 systemd
8523 matthia+ 20 0 323044 2996 16 S 0.0 0.0 0:00.00 (sd-pam)
8538 matthia+ 20 0 507976 8184 6972 S 0.0 0.1 0:00.02 pulseaudio
8588 matthia+ 20 0 76484 5756 5220 S 0.0 0.0 0:00.00 dbus-daemon
8590 matthia+ 20 0 522672 10796 7672 S 0.0 0.1 0:00.00 gvfsd
8595 matthia+ 20 0 379792 8264 7140 S 0.0 0.1 0:00.00 gvfsd-fuse
8852 matthia+ 20 0 163784 5260 4080 S 0.0 0.0 0:00.37 sshd
8855 matthia+ 20 0 235756 4616 3256 S 0.0 0.0 0:00.14 bash
9640 matthia+ 20 0 726992 52484 36644 T 0.0 0.3 0:00.18 python
9661 matthia+ 20 0 953636 254480 19736 T 0.0 1.6 1:27.65 python
9662 matthia+ 20 0 953736 225512 19272 T 0.0 1.4 1:27.68 python
9663 matthia+ 20 0 953768 251920 19736 T 0.0 1.6 1:27.68 python
9664 matthia+ 20 0 953744 236568 19736 T 0.0 1.5 1:27.67 python
9665 matthia+ 20 0 953644 217700 19356 T 0.0 1.4 1:27.66 python
9666 matthia+ 20 0 953600 246592 19736 T 0.0 1.6 1:27.65 python
9693 matthia+ 20 0 726992 274520 36152 T 0.0 1.7 0:00.21 python
9714 matthia+ 20 0 953636 476396 19532 T 0.0 3.0 0:03.29 python
9715 matthia+ 20 0 953736 476328 19436 T 0.0 3.0 0:03.29 python
9716 matthia+ 20 0 953768 476228 19724 T 0.0 3.0 0:03.30 python
9717 matthia+ 20 0 953744 475772 19172 T 0.0 3.0 0:03.29 python
9718 matthia+ 20 0 953644 475728 19252 T 0.0 3.0 0:03.30 python
9719 matthia+ 20 0 953600 476048 19464 T 0.0 3.0 0:03.29 python
9733 matthia+ 20 0 726992 277788 36444 T 0.0 1.8 0:00.21 python
9754 matthia+ 20 0 953624 479008 19684 T 0.0 3.0 2:03.45 python
9755 matthia+ 20 0 953744 479060 19664 T 0.0 3.0 2:03.44 python
9756 matthia+ 20 0 953780 479232 19688 T 0.0 3.0 2:03.39 python
9757 matthia+ 20 0 953744 478560 19464 T 0.0 3.0 2:03.43 python
9758 matthia+ 20 0 953628 478732 19448 T 0.0 3.0 2:03.41 python
9759 matthia+ 20 0 953600 478672 19612 T 0.0 3.0 2:03.42 python
9793 matthia+ 20 0 726992 278024 36296 T 0.0 1.8 0:00.21 python
9814 matthia+ 20 0 953624 471732 19568 T 0.0 3.0 0:10.65 python
9815 matthia+ 20 0 953744 476700 19568 T 0.0 3.0 0:10.67 python
9816 matthia+ 20 0 953780 473304 19568 T 0.0 3.0 0:10.68 python
9817 matthia+ 20 0 953744 478216 19404 T 0.0 3.0 0:10.65 python
9818 matthia+ 20 0 953628 477136 19408 T 0.0 3.0 0:10.65 python
9819 matthia+ 20 0 953600 476736 19568 T 0.0 3.0 0:10.66 python
9861 matthia+ 20 0 726856 282796 37132 T 0.0 1.8 0:00.21 python
9882 matthia+ 20 0 954020 485460 20132 T 0.0 3.1 0:15.55 python
9883 matthia+ 20 0 953972 485428 20000 T 0.0 3.1 0:15.51 python
9884 matthia+ 20 0 953636 485464 20128 T 0.0 3.1 0:15.61 python
9885 matthia+ 20 0 953612 485100 20028 T 0.0 3.1 0:15.59 python
9886 matthia+ 20 0 953492 484860 19952 T 0.0 3.1 0:15.59 python
9887 matthia+ 20 0 953500 484960 20068 T 0.0 3.1 0:15.54 python
9897 matthia+ 20 0 726868 288000 36904 T 0.0 1.8 0:00.19 python
9898 matthia+ 20 0 217080 948 872 T 0.0 0.0 0:00.00 tee
9922 matthia+ 20 0 954020 490580 19516 T 0.0 3.1 0:06.89 python
9923 matthia+ 20 0 953608 490400 19744 T 0.0 3.1 0:06.86 python
9924 matthia+ 20 0 953568 490224 19564 T 0.0 3.1 0:06.83 python
9925 matthia+ 20 0 953612 490228 19564 T 0.0 3.1 0:06.89 python
9926 matthia+ 20 0 953492 490096 19552 T 0.0 3.1 0:06.90 python
9927 matthia+ 20 0 953500 490296 19744 T 0.0 3.1 0:06.88 python
状态T
没有终止,它是“被作业控制信号停止”(man top)。
要使进程进入此状态,您可能已将 SIGSTOP
发送给它们 (kill -STOP ...
)。相反,您应该发送一个 SIGTERM
(默认值),您现在仍然可以这样做。如果这不起作用,请发送 SIGKILL
.