System Activity/zh-tw: Difference between revisions

From KDE UserBase Wiki
m (Created page with "選擇<menuchoice>顯示列'進程號' </menuchoice>。")
m (Created page with "==為什麼有的進程變灰淡出? ==")
Line 91: Line 91:




==Can System Activity show the I/O Hard Disk usage, like iotop?==
==為什麼有的進程變灰淡出? ==


Right click on the column headings, and choose <menuchoice>Show Column IO Read</menuchoice> and again for <menuchoice>Show Column IO Write</menuchoice>.  It will now show the amount of data being sent to or from the hard disk.
Right click on the column headings, and choose <menuchoice>Show Column IO Read</menuchoice> and again for <menuchoice>Show Column IO Write</menuchoice>.  It will now show the amount of data being sent to or from the hard disk.

Revision as of 11:26, 19 April 2011

介紹

系統活動近似於Microsoft Window的任務管理器,Apple Mac OS X的活動監視器以及GNOME的系統監視器。按住鍵盤快捷鍵Ctrl + Esc 或點擊 KRunner(Alt + F2))視窗左側的「系統活動」圖示就會彈出它。

它顯示當前運行進程的列表,外帶它們的CPU佔用,記憶體佔用和多種其他部分的信息。



一般提示

幾乎介面每個部分都有工具提示(當你懸停鼠標指針足夠久時)來提供更多詳細信息,“這是什麼功能”(點擊按鈕激活)解釋信息代表的意思。

例如,懸停指針到一個進程的CPU使用率上,我們會看到各種其他信息,包括這個程式總共運行了多長時間。



為什麼我當前系統運行的這麼慢?

一個系統會由於某個進程(程式)請求所有電腦處理能力(CPU使用)或占用所有電腦的記憶體而變得異常緩慢。

默認情況下,當前用戶擁有的進程中佔用大量CPU或記憶體的進程會靠近頂部。這意味著異常程式應該是靠近頂部,很容易分辨。舉個例子:



在這個例子中,firefox停止響應並佔用了99%的CPU。要終止這個異常的進程,點擊進程選定它並按下殺死進程 按鈕。它會發送一個請求(a polite request)給程式,要求它關閉。

我殺不了它 - 它不死!

謝天謝地這種事情很少見,僅僅偶爾你會遇到。如果某個進程異常的話它有可能會忽視你的終止請求,這時我們需要直接強制這個進程終止。這樣做可能會導致這個程式打開的文檔等未保存就關閉。要強制終止,這樣做,右擊進程並選擇“發送信號”,然後選擇殺掉(殺掉)

有時甚至這樣也無法殺掉進程,亦或是根本沒這個操作選項。這種情況在比如使用某些內核時發生。如果進程本身或是進程的某個線程引發內核bug,最終使得其陷入不停的執行內核操作中,便處於完全無法殺掉的狀態。通常除了重啟機子,沒其他解決方法了。

殭屍進程

殭屍狀態的進程已經死了,所以不能被殺死。系統繼續保留它們直到它們的父進程注意到回收它們,通常只需要很短時間。通常看到殭屍進程表明它的父進程已經停止響應了。

選取殺死一個視窗

如果你想要殺死某個特定的已經凍結停止響應的視窗,任意時刻簡單的按下 Ctrl + Alt + Esc 。鼠標指針會變成骷髏頭加十字交叉骨頭圖片(好可怕)。現在去點擊那個想殺掉的視窗。注意這會直接殺死程式,你可能會丟掉未保存的數據。

記憶體和共享記憶體有什麼區別?

「記憶體列」近似顯示進程本身大約使用的存儲器(RAM)數量。 「共享記憶體列」是,或可以說,近似被其他多個程式分享存取的存儲器。舉個例子,KDE 函數庫(libraries)被所有KDE程式使用,所以只會載入記憶體一次。

KDE SC 4.4 之後,你可以右擊進程,查看進程的詳細記憶體信息獲取更多準確讀數。

技術信息

「記憶體列」顯示的是VmRSS - Shared 的值,所以通常低於top 命令等顯示的值。這個值不包括被I/O 頁面支持(backed)的記憶體,被x server 佔用用於存儲程式使用的位圖的記憶體。這個值經常被叫作Unique RSS size,或URSS。接近詳細記憶體信息中顯示的私有記憶體使用(Private memory usage)的值。

「共享記憶體列」與top 命令中的SHR 列一樣,會有少許不准確。接近詳細記憶體信息中顯示的共享記憶體使用(Shared memory usage)的值。

尤其是進程表解析的是/proc/pid/stat詳細記憶體信息 對話框解析的是/proc/pid/smaps .

如何查看一個進程記憶體的更多詳細信息?

在 現在的 KDE 正式版中還未完成。在KDE SC 4.4 中,你可以在列表中選擇一個進程,右擊進程,選擇 詳細記憶體信息 ,隨後便會得到類似這樣的信息:



為什麼詳細記憶體信息 中的值跟進程列表中不一樣?

「系統活動」進程列表使用的是近似值。詳細記憶體信息給出的值更精確。

為什麼'Xorg'進程佔了那麼多記憶體?

這個進程負責顯示所有其他程式。它的記憶體佔用包括了顯卡中使用的用於儲存來自程式的圖形映射pixmaps(圖片)的顯存。

一般來說你不用去關心Xorg的記憶體佔用。

我怎樣能看到進程的PID?

如果你想看到單個進程的PID,只要懸停鼠標指針到進程名上。 PID會在工具提示中顯示出來。

如果你想看到所有進程的PID,右擊任意列標題,你會看到如下菜單:


選擇顯示列'進程號'


為什麼有的進程變灰淡出?

Right click on the column headings, and choose Show Column IO Read and again for Show Column IO Write. It will now show the amount of data being sent to or from the hard disk.

By right clicking on the column header you can chose whether you want to view the actual amount of data being written or read from the hard disk (the default), or whether you are interested in seeing how much data the application is sending or requesting from a file.

Data requested and actual data read from the hard disk are not equivalent - for example, if two applications read from the same file the operating system does not need to read from the actual hard disk twice - it can just read it once and remember it for a short while. Similarly, if one process writes to a file, but then another process writes over the top of that same file, there's no point writing the first version of the file to the actual hard disk.


Why are some processes grayed out?

For example the process xclock:



This means that the process has already died. It is shown as a disabled process just for convenience to make it easier to see processes that are quit. The values for the CPU usage, Memory usage, etc are just the values from when the process was last seen alive. A process that has ended does not take up any resources (it uses no CPU, memory etc).

What are all of these processes owned by root and taking up no memory?

These are kernel threads. They exist only inside the kernel, and exist to allow the kernel to perform multiple tasks in parallel.

They are shown because occasionally they can be a cause of heavy CPU usage. For example, under a heavy load, and with bad drivers, a network card can produce a huge number of interrupts, resulting in a high CPU usage in the ksoftirqd kernel thread.

Likewise, a high CPU usage in kjournald can indicate that DMA transfer is not enabled on the hard disk.

Why do I have so many processes?

A normal average-user system has around 150 to 200 processes with strange sounding names. It would be nice to setup a wiki page giving a short description of each of these processes, but so far nobody has done this.

Why is OpenOffice.org not showing up as a graphical program?

Before version 3.3, OpenOffice.org did not correctly implement the window standards. Specifically, their windows did not set _NET_WM_PID to link the windows to the process. This is now fixed in OpenOffice.org 3.3.

Why is gvim showing up strangely as a graphical program?

This is a fault with the GVim program. GVim does not correctly implement the window standards. Specifically, when it starts up it forks a new process to avoid hanging the shell that it ran from. But it sets the _NET_WIN_PID property to the previous PID. The authors have been notified but have not fixed this yet.