Firefox 使用大量 CPU

Joh*_*ohn 11 performance firefox

我有一台笔记本 nb510 Toshiba,装有 Ubuntu 12.04 和 firefox 22.0,带有 addock-plus、x-notifier、下载助手、xmarks 等扩展。有时它需要比 100% 更多的 cpu 这个 firefox 的信息:

@nb510:~$ top

top - 02:23:57 up 18 min,  2 users,  load average: 0.42, 0.39, 0.36
Tasks: 153 total,   1 running, 152 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.9%us,  0.8%sy,  0.0%ni, 95.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2047344k total,   741132k used,  1306212k free,    54984k buffers
Swap:  2068352k total,        0k used,  2068352k free,   370208k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND   
 2320 john      20   0  576m 117m  36m S   117  5.9   1:31.67 firefox          
 1015 root      20   0  120m  39m 7588 S    9  2.0   2:02.09 Xorg     
 2088 john      20   0 92592  15m  11m S    7  0.8   0:11.30 gnome-terminal     
 2183 john      20   0  2852 1176  888 R    1  0.1   0:08.58 top                
    9 root      20   0     0    0    0 S    0  0.0   0:06.83 kworker/1:0        
    1 root      20   0  3636 2052 1316 S    0  0.1   0:01.80 init               
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd           
    3 root      20   0     0    0    0 S    0  0.0   0:00.02 ksoftirqd/0        
    6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0        
    7 root      RT   0     0    0    0 S    0  0.0   0:00.24 watchdog/0         
    8 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1        
   10 root      20   0     0    0    0 S    0  0.0   0:00.13 ksoftirqd/1        
   12 root      RT   0     0    0    0 S    0  0.0   0:00.05 watchdog/1         
   13 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/2        
   15 root      20   0     0    0    0 S    0  0.0   0:00.03 ksoftirqd/2        
   16 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/2         
   17 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/3        
   18 root      20   0     0    0    0 S    0  0.0   0:00.88 kworker/3:0
Run Code Online (Sandbox Code Playgroud)

这来自火狐

  Paramètres de base de l'application

        Nom
        Firefox

        Version
        22.0

        Agent utilisateur
        Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0

        Configuration de compilation

          about:buildconfig

  Extensions

        Nom

        Version

        Activée

        ID

        British English Dictionary
        1.19.1
        true
        en-GB@dictionaries.addons.mozilla.org

        DownloadHelper
        4.9.17
        true
        {b9db16a4-6edc-47ec-a1f4-b86292ed211d}

        Element Hiding Helper pour Adblock Plus
        1.2.3
        true
        elemhidehelper@adblockplus.org

        Ubuntu Firefox Modifications
        2.6
        true
        ubufox@ubuntu.com

        Xmarks
        4.2.1
        true
        foxmarks@kei.com

        X-notifier
        3.3.3
        true
        {37fa1426-b82d-11db-8314-0800200c9a66}

  Préférences modifiées importantes

      Nom

      Valeur

        accessibility.typeaheadfind.flashBar
        0

        browser.cache.disk.capacity
        1048576

        browser.cache.disk.smart_size_cached_value
        1048576

        browser.cache.disk.smart_size.first_run
        false

        browser.places.smartBookmarksVersion
        4

        browser.startup.homepage
        http://www.google.fr/ig

        browser.startup.homepage_override.buildID
        20130627161504

        browser.startup.homepage_override.mstone
        22.0

        dom.mozApps.used
        true

        extensions.lastAppVersion
        22.0

        network.cookie.prefsMigrated
        true

        places.database.lastMaintenance
        1375143077

        places.history.expiration.transient_current_max_pages
        52413

        plugin.disable_full_page_plugin_for_types
        application/pdf

        plugin.importedState
        true

        privacy.sanitize.migrateFx3Prefs
        true

        security.warn_viewing_mixed
        false

        storage.vacuum.last.index
        0

        storage.vacuum.last.places.sqlite
        1375140331

  Accélération graphique

        Description de la carte
        VMware, Inc. -- Gallium 0.4 on llvmpipe (LLVM 0x300)

        Fenêtres avec accélération graphique
        0/1 Basic Bloqué pour la version de votre pilote graphique.

        ID du périphérique
        Gallium 0.4 on llvmpipe (LLVM 0x300)

        ID du vendeur
        VMware, Inc.

        Rendu WebGL
        Bloqué pour la version de votre pilote graphique.

        Version du pilote
        2.1 Mesa 8.0.4

        AzureCanvasBackend
        cairo

        AzureContentBackend
        none

        AzureFallbackCanvasBackend
        none

  JavaScript

        Ramasse-miettes incrémentiel
        true

  Accessibilité

        Activée
        false

        Empêcher l'accessibilité
        0

  Versions des bibliothèques

        Version minimale attendue

        Version utilisée

        NSPR
        4.9.6
        4.9.6

        NSS
        3.14.3.0 Basic ECC
        3.14.3.0 Basic ECC

        NSSSMIME
        3.14.3.0 Basic ECC
        3.14.3.0 Basic ECC

        NSSSSL
        3.14.3.0 Basic ECC
        3.14.3.0 Basic ECC

        NSSUTIL
        3.14.3.0
        3.14.3.0
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助

Bra*_*iam 13

在我看来,您没有使用硬件加速(这可能会导致高 CPU 消耗,或者您的硬件不支持它)。如果您更新并正确配置了视频驱动程序,您可以强制 Firefox 使用硬件加速:

  1. 打开about:config,接受你知道你在做什么(技术上是我)
  2. 搜索layers.acceleration.force-enabled。如果未创建,请右键单击空白区域,点击新建 > 布尔值,并将其命名为layers.acceleration.force-enabled.
  3. 右键单击layers.acceleration.force-enabled并点击Toggle
  4. 重新启动 firefox 并检查您的 CPU 消耗,现在应该可以管理了。

如何知道您是否有 HW-Accel

  1. 打开一个终端。
  2. sudo apt-get install mesa-utils
  3. 一旦完成运行 glxinfo | grep render
  4. 它应该有一行内容:

    直接渲染:

    OpenGL 渲染器字符串:ATI RV515 上的 Gallium 0.4 (此行可以是任何内容)

如果显示No或第二行显示Software rasterizer,则意味着您注定需要配置视频卡(如果它支持 HWA)或购买新的 shinny 卡。


man*_*una 5

速度变慢的根源很可能是安装的一个或多个 FF 扩展。尝试将它们一一禁用,看看它们是否会导致问题。最初,您可以禁用所有这些,看看 FF 在您的情况下消耗的资源是否明显减少(Help菜单中有一个选项Restart with Add-ons Disabled...

请参阅此处的详细说明: https: //support.mozilla.org/en-US/kb/troubleshoot-extensions-themes-to-fix-problems

UPD:有一个已知有问题的 FF 扩展列表,以简化问题检测: http: //kb.mozillazine.org/Problematic_extensions