Saturday, December 22, 2018

Easily Process Kill ( hanged process) by windows shell

Windows Shell Tutorial လေးပါ..အခုကတော့ system resource တွေအဆမတန် consume လုပ်နေတဲ့ process တွေ...computer system ကြီးတစ်ခုလုံးကို Hang သွားအောင်လုပ်တတ်တဲ့ process တွေကို လွယ်လွယ်ကူကူ kill နိုင်စေမှာပါ ( with just one command !!!)


Process ဆိုတာဘာလဲ
Computer System ပေါ်မှာ result တစ်ခုခုအတွက် ဖွင့်ပြီး run ထားတဲ့ process တွေကိုဆိုလိုတာပါ..ဥပမာ..သင်က computer ပေါ်မှာ internet ကြည့်ချင်တယ်...အဲဒီလိုကြည့်ချင်တဲ့ result အတွက် mozilla firefox ကိုဖွင့်ရပါတယ်...ဒါဆို process ဖြစ်ရောလား...no par ဗျာ....


ဘာလို့ လဲ


သင်ကအခု mozilla firefox ကိုဖွင့်ထားတာပဲရှိသေးတာလေ....သင့် computer က network ချိတ်ထား ပြီး internet ရဖို့လည်းလိုသေးတယ်ဗျ....ဒါတင်ပဲလား.....နောက်ပြီး အဲဒီ mozilla ကြီးကသင့် desktop ကြီးမှာ run နိုင်ဖို့လိုအပ်တဲ့ cpu usage တွေ...memory usage တွေ...disk usage ( cache နဲ့အခြား data တွေဖြစ်တဲ့ bookmark တို့..cookies တို့သိမ်းဖို့.buffer cache လုပ်ဖို့...)...ဒါတွေလိုပါတယ်...


ဆိုလိုချင်တာကတော့ဗျာ...သင့်စက်က windows 7 32-bit ...CPU -core i3 4xxx Generation နဲ့ 4GB-Memory, HDD-400 GB မှာ mozilla run ဖို့ လိုအပ်တဲ့ shared system resources တွေ ( CPU, memory, Disk,Network,...) ကိုတစ်ပြိုင်နက်တည်းသုံးတော့မှ သင်က mozilla firefox ကနေ internet  ကြည့်နိုင်မှာပါ....


mozilla process တစ်ခု run ဖို့ အတွက်လိုအပ်တဲ့ system resource ဆိုတာကို System ကြီးကနေ shared လုပ်ပြီးသုံးပါတယ်...ဆိုလိုတာကတော့ဗျာ....သင့် memory က 4GB ရှိတယ်...4GB လုံးထဲကနေ သူကလိုသလောက် resource တွေကိုယူယူသုံးသွားတယ်... windows task manager နဲ့ ကြည့်နိုင်ပါတယ်
ကဲ...mozilla မှာ tab တွေဖွင့်လိုက်တယ်...system resource usage တွေတက်လာတယ်...ကဲ...CPU ဘယ်လောက်...memory ဘယ်လောက်...Disk ကဘယ်လောက်...Network ကဘယ်လောက်..အသီးသီးသုံးပြီးတော့ mozilla firefox ဆိုတဲ့ process ကြီးကို run စေသလဲဆိုတာမြင်လောက်ပါပြီ.....


ဒီတော့ process တစ်ခု parent process မှာ child process လို့ ခေါ်တဲ့ network I/O တွေ...disk I/O တွေ....CPU...Memory...ဒါတွေအားလုံးနဲ ့တစ်ပြိုင်နက်တည်းပူးပေါင်းအလုပ်လုပ်မှ firefox ကနေ internet ကြည့်လို ့ရသွားတာပါ....


* ဒီအထဲမှာ တစ်ခုခုချို့ယွင်းနေတယ်ဆိုတာ...သင့် firefox ကနေ internet ကြည့်လို့ရမှာမဟုတ်ပါဘူး....


Error on Windows Desktop

အခုကကျွန်တော့် windows desktop မှာ firefox မှာ tab တွေအများကြီးဖွင့်လိုက်တဲ့အခါကျတော့ စက်က hang သွားပါပြီ ...

ကဲ...ဒီတော့ task manager ကိုခေါ်ကြည့်တယ်....


 ကဲ.... firefox ဆိုတဲ့ process ကလည်း not responding ဖြစ်ပြီးတော့ disk usage ကလည်း 100% ဖြစ်နေပြီ...task manager ကနေလည်းဘာမှနှိပ်လို့မရဘူး....ဒီတော့ windows command prompt ခေါ်လိုက်တယ်...


ပေါ်လာတဲ့ command prompt ထဲမှာ ဒီလိုလေးရိုက်လိုက်တယ်..

C:\> taskkill /f /im firefox.exe 


အဲဒါလေးလည်းရိုက်လိုက်ကော....


hang ပြီးတော့ကိုယ့်စက်ကိုဘာမှလုပ်လို့မရအောင် လုပ်နေတဲ့ firefox ဆိုတဲ့ process ကြီး terminated  ဖြစ်သွားပါပြီ...hang ပြီးတော့ အဆင်မပြေဖြစ်နေတဲ့စက်ကပြန်ကောင်းသွားပါပြီ....


ကျွန်တော် သုံးသွားတဲ့ parameter တွေက taskkill ( task ကို kill လုပ်မယ်..) .....ပြီးတော့ /f parameter ..( ဒါကတော့ forcely terminate လုပ်မယ်ပေါ့ဗျာ...Linux မှာဆိုရင်တော့ kill -9 လို့ ပြောရမယ်ထင်တယ်)...ပြီးတော့ /im paramter ( Image Name ..ဒါ ကျွန်တော်တို့ terminated လုပ်မယ့် process image name ပေါ့) သူ့နောက်မှာမှ ကျွန်တော်တို့ terminated လုပ်မယ့် firefox.exe ပေါ့...( တကယ်လို့  terminated လုပ်မယ့် process က chrome ဆိုရင် chrome.exe ပေါ့ဗျာ....microsoft excel ဆိုရင်လည်း excel.exe ပေါ့ဗျာ)


ဒါဆိုရင် hang နေတဲ့ process ကို forcefully terminated လုပ်လိုက်လို့ကိုယ့်စက် ကို အေးဆေးသုံးနိုင်ပါပြီ...တစ်ခါတစ်လေ...Excel တို့..word တို့လည်းဖွင့်ထားတယ်...firefox လည်းဖွင့်ရင်းနဲ့ များသွားရင် ဒီလိုမျိုးတွေဖြစ်တတ်ပါတယ်...


Disadvantages 

အားနည်းချက်က firefox မှာလုပ်လက်စအလုပ်တွေ (ဥပမာ...web protal access တွေ...mobile banking တွေ run ထားရင်တော့...)ကတော့ပျောက်သွားတတ်ပါတယ်...တစ်ချို့ အခြေအနေတွေမှာ web browser တွေမှာ auto-recovery on ထားရင်တော့ browser ပြန်ဖွင့်ရင် "restore previous sessions" ကနေနဂိုလုပ်နေတဲ့ နေရာလေးတွေပြန်ရတတ်ပါတယ်...


ကဲ....hang နေတဲ့ process ကို windows shell ကနေ ဘယ်လို terminate လုပ်သလဲဆိုတဲ့ tutorial လေးရေးသားပြီးစီးပါကြောင်း...အားလုံးလည်းပညာဗဟုသုတကြွယ်ဝတိုးတက်ကြပါစေကြောင်းရေးသားလိုက်ရပါတယ်...

Best Regards 

Phyo Sithu 
B.Sc(Physics)
Diploma in IT 
Red Hat Certified System Administrator ( RedHat - RHCSA)
Certified Ethical Hacker ( CEH - EC-Council)
Cisco Certified Network Associate ( Cisco CCNA)
Fortigate NSE Associate 
Symantec Cloud Security Administrator
Engenius Network Associate
Zyxel Certified Network Professional




No comments:

ping script ေလးနဲ့ အထာကျကျကိုယ့် server ေလးတွေအခြေအနေကိုစစ်ကြမယ်....

ပုံမှန်အားဖြင့်ကျွန်တော်တို့ဟာ ping command ကိုအသုံးပြုပြီးတော့ ကိုယ့်စက်ရယ်...ကိုယ့် network ထဲမှာ internet connection ရမရစစ်ဆေးလေ့ရှိကြပါတ...