在我的ubuntu机器中,git进程的数量突然运行。这消耗了大部分内存导致我的机器停止工作。
$ ps aux | grep git
1417676764 13890 8.0 0.2 32428 11584 ? R 18:04 0:08 git ls-files --others --exclude-standard
1417676764 14143 8.5 0.3 32560 11696 ? R 18:04 0:09 git ls-files --others --exclude-standard
1417676764 14380 8.1 0.2 32300 11476 ? R 18:04 0:08 git ls-files --others --exclude-standard
1417676764 14518 8.9 0.3 32592 11768 ? R 18:04 0:08 git ls-files --others --exclude-standard
1417676764 14851 8.3 0.2 32204 11372 ? R 18:04 0:08 git ls-files --others --exclude-standard
1417676764 14994 8.3 0.2 32104 11196 ? R 18:04 0:07 git ls-files --others --exclude-standard
1417676764 15127 9.0 0.2 32204 11368 ? R 18:04 0:08 git ls-files --others --exclude-standard
1417676764 15261 8.2 0.2 31424 10544 ? R 18:04 0:07 git ls-files --others --exclude-standard
1417676764 15392 8.0 0.2 31148 10260 ? R 18:05 0:06 git ls-files --others --exclude-standard
1417676764 15524 8.0 0.2 31044 10136 ? R 18:05 0:06 git ls-files --others --exclude-standard
1417676764 15662 8.3 0.2 31044 10140 ? R 18:05 0:06 git ls-files --others --exclude-standard
1417676764 15794 8.7 0.2 31044 10136 ? R 18:05 0:06 git ls-files --others --exclude-standard
1417676764 15938 8.7 0.2 30948 9992 ? R 18:05 0:06 git ls-files --others --exclude-standard
1417676764 16073 8.3 0.2 30396 9444 ? R 18:05 0:05 git ls-files --others --exclude-standard
1417676764 16197 8.9 0.2 30852 9868 ? R 18:05 0:05 git ls-files --others --exclude-standard
1417676764 16334 9.2 0.2 30948 9992 ? R 18:05 0:05 git ls-files --others --exclude-standard
1417676764 16473 8.2 0.2 29528 8708 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 16611 8.3 0.2 29424 8484 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 16783 7.7 0.1 28556 7612 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 16891 8.0 0.2 28780 7884 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 17019 8.0 0.1 28556 7608 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 17145 9.5 0.2 29044 8016 ? R 18:05 0:04 git ls-files --others --exclude-standard
1417676764 17289 8.4 0.1 28392 7332 ? R 18:05 0:03 git ls-files --others --exclude-standard
1417676764 17427 7.8 0.1 28064 7132 ? R 18:05 0:03 git ls-files --others --exclude-standard
1417676764 17582 7.4 0.1 27460 6488 ? R 18:05 0:02 git ls-files --others --exclude-standard
1417676764 17756 7.9 0.1 27112 6156 ? R 18:05 0:02 git ls-files --others --exclude-standard
1417676764 17854 9.2 0.2 28848 7912 ? R 18:05 0:03 git ls-files --others --exclude-standard
1417676764 18001 9.6 0.1 27460 6488 ? R 18:05 0:03 git ls-files --others --exclude-standard
1417676764 18130 6.6 0.1 26260 5392 ? R 18:05 0:01 git ls-files --others --exclude-standard
1417676764 18256 7.7 0.1 26364 5636 ? R 18:05 0:02 git ls-files --others --exclude-standard
1417676764 18390 6.3 0.1 25492 4720 ? R 18:06 0:01 git ls-files --others --exclude-standard
1417676764 19260 43.5 0.2 29292 8488 ? R 18:06 0:04 git ls-files --others --exclude-standard
1417676764 19386 45.5 0.2 28652 7796 ? R 18:06 0:03 git ls-files --others --exclude-standard
1417676764 19514 52.8 0.2 30592 9644 ? R 18:06 0:03 git ls-files --others --exclude-standard
1417676764 19685 46.5 0.1 24964 4212 ? R 18:06 0:00 git ls-files --others --exclude-standard
1417676764 19774 0.0 0.0 13612 876 pts/1 S+ 18:06 0:00 grep --color=auto git
这些过程随着时间的推移而不断增加。
我使用以下命令作为临时解决方案杀死了进程,
$ pkill git
但无法找出git作为进程运行的原因。
$ pstree -apl
命令为我提供了以下输出。
|-tmux,3001 -2
| |-bash,3002
| | `-pstree,10343 -apl
| |-sh,3003 -c ~/tmux-powerline/powerline.sh left
| | `-bash,3005 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3528 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3550 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3557 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,3559 ls-files --others --exclude-standard
| | `-wc,3560 -l
| |-sh,3333 -c ~/tmux-powerline/powerline.sh left
| | `-bash,3335 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3527 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3549 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3555 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,3556 ls-files --others --exclude-standard
| | `-wc,3558 -l
| |-sh,3573 -c ~/tmux-powerline/powerline.sh left
| | `-bash,3575 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3728 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3739 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3742 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,3743 ls-files --others --exclude-standard
| | `-wc,3744 -l
| |-sh,3800 -c ~/tmux-powerline/powerline.sh left
| | `-bash,3801 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3909 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3920 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,3923 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,3924 ls-files --others --exclude-standard
| | `-wc,3925 -l
| |-sh,3926 -c ~/tmux-powerline/powerline.sh left
| | `-bash,3927 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4035 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4046 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4049 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4050 ls-files --others --exclude-standard
| | `-wc,4051 -l
| |-sh,4052 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4053 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4161 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4172 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4175 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4176 ls-files --others --exclude-standard
| | `-wc,4177 -l
| |-sh,4178 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4179 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4287 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4298 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4301 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4302 ls-files --others --exclude-standard
| | `-wc,4303 -l
| |-sh,4305 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4306 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4414 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4425 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4428 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4429 ls-files --others --exclude-standard
| | `-wc,4430 -l
| |-sh,4432 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4433 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4541 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4552 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4555 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4556 ls-files --others --exclude-standard
| | `-wc,4557 -l
| |-sh,4558 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4559 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4667 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4678 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4681 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4682 ls-files --others --exclude-standard
| | `-wc,4683 -l
| |-sh,4684 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4685 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4793 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4804 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4807 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4808 ls-files --others --exclude-standard
| | `-wc,4809 -l
| |-sh,4810 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4811 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4919 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4930 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,4933 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,4934 ls-files --others --exclude-standard
| | `-wc,4935 -l
| |-sh,4936 -c ~/tmux-powerline/powerline.sh left
| | `-bash,4937 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5045 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5056 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5059 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,5060 ls-files --others --exclude-standard
| | `-wc,5061 -l
| |-sh,5062 -c ~/tmux-powerline/powerline.sh left
| | `-bash,5063 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5171 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5182 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5185 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,5186 ls-files --others --exclude-standard
| | `-wc,5187 -l
| |-sh,5188 -c ~/tmux-powerline/powerline.sh left
| | `-bash,5189 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5297 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5308 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5311 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,5312 ls-files --others --exclude-standard
| | `-wc,5313 -l
| |-sh,5358 -c ~/tmux-powerline/powerline.sh left
| | `-bash,5359 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5467 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5478 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5481 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,5482 ls-files --others --exclude-standard
| | `-wc,5483 -l
| |-sh,5489 -c ~/tmux-powerline/powerline.sh left
| | `-bash,5490 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5598 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5609 /home/prayag/tmux-powerline/powerline.sh left
| | `-bash,5612 /home/prayag/tmux-powerline/powerline.sh left
| | |-git,5613 ls-files --others --exclude-standard
| | `-wc,5614 -l
答案 0 :(得分:2)
在这些情况下,pstree
可以帮助您确定流程的启动位置:
pstree -apl
将列出所有正在运行的进程及其父进程(=启动它的进程)。这应该可以帮助你找出推出所有这些git进程的内容。
如果您已经弄明白了,可以看看如何阻止它们被启动...