최근 Windows 리소스 관리자를 통해 내 WSL(ZSHELL)이 CPU 리소스(약 35%)를 많이 소모한다는 사실을 발견했습니다.
그런 다음 나는 이 문제를 다음과 같이 찾아 해결하려고 노력합니다.
~ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Mar28 ? 00:00:00 /init ro
root 3 1 0 Mar28 tty1 00:00:00 /init ro
mbinary 4 3 0 Mar28 tty1 00:00:12 -zsh
mbinary 48 1 0 Mar28 tty1 00:00:00 [awk] <defunct>
mbinary 66 1 0 Mar28 tty1 00:00:00 [awk] <defunct>
mbinary 173 1 0 Mar29 tty1 00:00:00 [awk] <defunct>
mbinary 225 1 0 Mar29 tty1 00:00:00 [awk] <defunct>
mbinary 431 1 0 09:45 tty1 00:00:00 [awk] <defunct>
root 6845 1 0 09:53 tty2 00:00:00 /init ro
mbinary 6846 6845 0 09:53 tty2 00:00:04 -zsh
mbinary 7419 6846 0 10:03 tty2 00:00:00 python3
mbinary 7455 1 0 14:42 tty1 00:00:00 [awk] <defunct>
mbinary 7522 1 0 14:42 tty1 00:00:00 [awk] <defunct>
mbinary 7559 1 0 14:43 tty1 00:00:00 [awk] <defunct>
mbinary 7587 1 0 14:48 tty1 00:00:00 [awk] <defunct>
mbinary 7595 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7604 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7643 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7666 1 97 15:03 tty1 00:00:21 -zsh
mbinary 7670 7666 0 15:03 tty1 00:00:00 [awk] <defunct>
mbinary 7699 4 0 15:03 tty1 00:00:00 ps -ef
➜ ~ sudo kill -9 1
➜ ~ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Mar28 ? 00:00:00 /init ro
root 3 1 0 Mar28 tty1 00:00:00 /init ro
mbinary 4 3 0 Mar28 tty1 00:00:12 -zsh
mbinary 48 1 0 Mar28 tty1 00:00:00 [awk] <defunct>
mbinary 66 1 0 Mar28 tty1 00:00:00 [awk] <defunct>
mbinary 173 1 0 Mar29 tty1 00:00:00 [awk] <defunct>
mbinary 225 1 0 Mar29 tty1 00:00:00 [awk] <defunct>
mbinary 431 1 0 09:45 tty1 00:00:00 [awk] <defunct>
root 6845 1 0 09:53 tty2 00:00:00 /init ro
mbinary 6846 6845 0 09:53 tty2 00:00:04 -zsh
mbinary 7419 6846 0 10:03 tty2 00:00:00 python3
mbinary 7455 1 0 14:42 tty1 00:00:00 [awk] <defunct>
mbinary 7522 1 0 14:42 tty1 00:00:00 [awk] <defunct>
mbinary 7559 1 0 14:43 tty1 00:00:00 [awk] <defunct>
mbinary 7587 1 0 14:48 tty1 00:00:00 [awk] <defunct>
mbinary 7595 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7604 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7643 1 0 14:49 tty1 00:00:00 [awk] <defunct>
mbinary 7666 1 99 15:03 tty1 00:00:25 -zsh
mbinary 7670 7666 0 15:03 tty1 00:00:00 [awk] <defunct>
mbinary 7712 4 0 15:03 tty1 00:00:00 ps -ef
작동하지 않습니다.
awk
명령을 사용한 후에 좀비 프로세스가 발생하는 것을 발견했습니다 z
.
정보: Windows 10: 1809 WSL: 우분투 1804
답변1
Microsoft Windows 10 Pro(64비트) 버전 10.0.18362를 실행하고 있는데 여전히 불량 zsh 프로세스가 발생합니다. 이 기능은 불량 zsh 프로세스를 종료합니다.
killzshs(){ps ax -o pid,command,ppid | grep '.*zsh.*\s1$' | awk '{print $1}' | xargs kill -9}
killzshs
그런 다음 함수를 호출 하거나 도트 파일에 넣습니다.
답변2
이 문제는 Windows 버전 10.0.18362.30에서 해결되었습니다. 세부여기