Versionen vergleichen

内存消耗严重

Version 37689:

Version 37689 von decency8035 am

Version 52450:

Version 52450 von CnSimonChan am

Schlüsselwörter:

内存 太多 占用 过多
内存 太多 占用 过多

Zusammenfassung für die Suchergebnisse:

Firefox 有时使用过多内存。本文讲述了如何让 Firefox 少用一些内存。
Firefox 有时使用过多内存。本文讲述了如何让 Firefox 少用一些内存。

Inhalt:

Firefox 有时会使用过多内存,以致于影响性能,极端的情况下甚至会引起崩溃。本文将介绍如何让Firefox使用更少内存。 * 根据您的操作系统,您可以通过特定的工具查看和监视内存使用情况。{for win}在Windows上,Windows任务管理器可以显示 Firefox 整体的内存使用情况。{/for} {note}'''注意:'''如果您[[Send performance data to Mozilla to help improve Firefox|发送了性能信息(启用遥测)]],Mozilla将收集包括您的内存使用情况的数据,并在未来的Firefox中改进。{/note} __TOC__ = 更新到最新版 = 最新的Firefox大大减少了内存使用。强烈推荐[[Update Firefox to the latest version|更新Firefox到最新版]]。 = 扩展与主题 = ==禁用消耗内存的扩展和主题== 扩展与主题可能使使用 Firefox 过多内存。 要确定 Firefox 内存消耗严重的原因是否来自扩展与主题,请用[[Troubleshoot Firefox issues using Safe Mode|安全模式]]启动 Firefox,然后关注一下内存占用。在安全模式下,扩展与主题是禁用的,如果内存占用有明显好转,您可以试着禁用或卸载某些扩展或主题。 * 关于启动安全模式和查找扩展与主题问题的更多信息,请查阅[[Troubleshooting extensions and themes]]。 此外,您还可以通过[https://support.mozilla.org/zh-CN/kb/排查内存具体使用情况 about:addons-memory 扩展]来直接查看各个扩展和主题大致的扩展内存使用情况。 {note}'''注意:'''安装许多扩展并不会导致占用过大,只有个别低效率的扩展才会有较大占用,影响性能。{/note} = 插件 = 用于显示特殊页面元素的插件,尤其是过时的旧版插件,可能会严重消耗内存。 要确定 Firefox 内存消耗严重的原因是否来自某个插件,您可以试着禁用有选择性地禁用一些插件: # {for win,linux}在 Firefox 窗口顶端{/for}{for mac}在菜单栏{/for},点击{menu 工具}菜单并选择{menu 附加组件}。这将打开附加组件管理器。 # 选择{menu 插件}面板。 # 选择列表中的一个插件,点击{button 禁用}以禁用它。 # 再对其他您想禁用的插件进行同样的操作。 禁用一些插件后,退出并重新启动 Firefox,然后关注一下内存占用。如果没有明显改善,则可以重新启用这些刚才禁用的插件,再试着禁用另一组。 如果禁用某个插件后内存占用有明显改善,您可以保持禁用它,或者查找它的更新。[[Popular plugins]]一文中列出了一些插件及相关的更新方式。 <!-- Commented out for monkey reasons. = Settings that reduce memory usage = Firefox has hidden settings that let you change how it uses memory. == Memory cache == Firefox caches image and interface data in memory so they can be displayed quickly. You can see how much memory Firefox uses for this purpose. # Type '''about:cache''' in the Location Bar at the top of the Firefox window and press {for win,linux}{key Enter}{/for}{for mac}{key Return}{/for}. # A page listing your Firefox cache information should appear. Under the '''Memory cache device''' heading, '''Maximum storage size''' refers to the maximum amount of memory Firefox will use for this purpose, and '''Storage in use''' refers to the current amount of memory Firefox is using for this purpose. By default, Firefox will use more memory on computers with more memory installed. You can change the limit for your computer. ;:{note}'''Lowering the amount of memory available for caching will increase the amount of time Firefox takes to display web pages and dialogs.'''{/note} # [[T:aboutconfig]] # The about:config page should appear. {for win,linux}Right-click{/for}{for mac}Hold down the {key Ctrl} key while you click{/for} in the main part of the window, then select {menu New}, and then slect {menu Integer}.<br/> <br/>[[Image:highmemusage-newinteger.png]] <br/> <br/> # When prompted, type {pref browser.cache.memory.capacity} and press {button OK}. # Next, type the maximum number of kilobytes you want Firefox to use for cache and press {button OK}. If you want to set the preference back to its default value: # [[T:aboutconfig]] # Search for the preference {pref browser.cache.memory.capacity}. # {for win,linux}Right-click{/for}{for mac}Hold down the {key Ctrl} key while you click{/for} the entry for browser.cache.memory.capacity and press {menu Reset}. == Cached previously viewed pages == Firefox stores pages in memory so they can be displayed quickly when you press Back or Forward. By default, Firefox will use more memory on computers that have more memory installed. You can change the maximum number of pages Firefox will store for this purpose on your computer. ;:{note}'''Lowering the number of stored pages will slow down Firefox when you press Back or Forward.'''{/note} # [[T:aboutconfig]] # The about:config page should appear. Search for the preference {pref browser.sessionhistory.max_total_viewers}, and double-click on it. # In the browser.sessionhistory.max_total_viewers prompt, type the maximum number of pages you want Firefox to store and press {button OK}. If you want to set the preference back to its default value: # [[T:aboutconfig]] # Search for the preference {pref browser.sessionhistory.max_total_viewers}. # {for win,linux}Right-click{/for}{for mac}Hold down the {key Ctrl} key while you click{/for} the entry for browser.sessionhistory.max_total_viewers and press {menu Reset}. {for win} == Behavior on minimize == By default, Firefox will allow Windows to reclaim its memory when Windows needs it for other programs. Firefox can be configured to allow Windows to reclaim its memory immediately. ;:{note}'''Allowing Windows to reclaim the memory immediately will make Firefox slower to come up after being minimized.'''{/note} # [[T:aboutconfig]] # The about:config page should appear. Right-click anywhere in the grid and choose {menu New}, then {menu Boolean}. # In the Enter the preference name prompt, type {pref config.trim_on_minimize} and press {button OK}. # Next, choose {pref True} and press {button OK}. If you want to set the preference back to its default value: # [[T:aboutconfig]] # Search for the preference {pref config.trim_on_minimize}. # Right-click the entry for config.trim_on_minimize and press {menu Reset}. {/for} --> = 重新启动 Firefox = Firefox 长时间开着,内存消耗可能会逐渐增加。一个折衷的方法是定期重启一下 Firefox。您可以设置让 Firefox 记住您的标签页和窗口,以便在重启后回到之前的状态。请查阅[[Session Restore]]以了解详情。 = 减少打开的标签数 = 每个标签页都要消耗一定的内存来显示网页。如果您总是打开'''超过100个标签页'''的话,您可以考虑是否换一种更轻便的方式来组织您要浏览的页面和要完成的任务,例如: * [[Bookmarks|书签]]。''提示:"[[Tabbed Browsing#Bookmarks and Tabbed Browsing|将所有标签页加入书签]]"可以一资助添加一批标签页到书签。'' * [http://lifehacker.com/378062/five-best-gtd-applications 任务列表类应用]。 = 内存诊断工具 = <!-- Memory issues can be difficult to troubleshoot because they are normally visible only in aggregate. Furthermore, there are four broad categories of bugs that can lead to high memory use, which can be hard to distinguish. * ''Bloat'', or using a large amount of memory to store a small amount of information. (Goes away when you close each tab.) * ''Caching'', or intentionally remembering something for a limited time in case it is needed again. (Usually less than 100MB.) * ''Fragmentation'', or failing to re-use free memory. (Usually limited to 2X.) * ''Leaking'', or continuing to store data in memory after it is no longer needed. --> * '''[https://support.mozilla.org/zh-CN/kb/排查内存具体使用情况 about:addons-memory]''':让您可以直观地查看各附加组件的内存占用情况。 还有Firefox 开发人员制作的两个扩展,可以帮助您锁定内存泄漏类的 bug: * '''[https://addons.mozilla.org/firefox/addon/2490 Leak Monitor]''':在出现某种内存泄漏时立即给出警告。这有助于第一时间发现泄漏的原因。 * '''[https://addons.mozilla.org/firefox/addon/5972 RAMBack]''':帮助您清空 Firefox 的各种缓存区域,方便您区分缓冲(caching)和泄漏(leaking)。 如果您是 C++ 程序员,您可以试试[https://wiki.mozilla.org/Performance:Leak_Tools Firefox 开发人员常用的泄漏调试工具]。 <!-- Jesse Ruderman would be happy to walk users through setting up trace-refcnt! --> <!-- MZ credit --> <br/> <br/> '''''信息来源:[http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox Reducing memory usage - Firefox (mozillaZine KB)]'''''
Firefox 有时会使用过多的内存,以致于影响性能,极端的情况下甚至会引起崩溃。本文将介绍如何让 Firefox 使用较少的内存。 * 根据您的操作系统,您可以通过特定的工具查看和监视内存使用情况。{for win}在 Windows 上,Windows 任务管理器的 性能 选项卡可以显示内存使用情况。{/for} {note}'''注:'''如果您[[Send performance data to Mozilla to help improve Firefox|发送了性能信息(启用遥测)]],Mozilla 将收集包括您的内存使用情况的数据,并用于改进 Firefox。{/note} __TOC__ = 更新到最新版 = 最新的 Firefox 能减少内存占用。强烈推荐您[[Update Firefox to the latest version|更新 Firefox 到最新版]]。 = 扩展与主题 = == 禁用消耗内存的扩展和主题 == 扩展与主题可能使 Firefox 使用过多的内存。 要确定 Firefox 内存消耗严重的原因是否来自扩展与主题,请用[[Troubleshoot Firefox issues using Safe Mode|安全模式]]启动 Firefox,然后关注一下内存占用。安全模式下将会禁用扩展与主题,所以如果内存占用有明显好转,您可以试着禁用或卸载某些扩展或主题。 * 关于安全模式和查找扩展与主题问题的更多信息,请查阅[[Troubleshooting extensions and themes]]。 此外,您还可以通过[https://support.mozilla.org/zh-CN/kb/排查内存具体使用情况 about:addons-memory 扩展]来直接查看各个扩展和主题大致的内存使用情况。 {note}'''注意:'''安装许多扩展并不会导致占用过大,只有个别低效率的扩展才会有较大占用,影响性能。{/note} == 隐藏无用内容 == 许多页面包括您不需要的内容(比如广告),显示这些内容也会占用内存(请参阅 [[#w_acki|插件]] 一节)。一些扩展可以过滤这些不需要的内容: * [https://addons.mozilla.org/firefox/addon/adblock-plus/ Adblock Plus] 可以过滤页面上的广告。 * [https://addons.mozilla.org/firefox/addon/flashblock Flashblock] 可以使您选择是否启用 Flash。 * [https://addons.mozilla.org/firefox/addon/noscript NoScript] 可以使您选择是否在页面上运行脚本。 = 插件 = 用于显示某些类型的页面元素的插件,尤其是旧版本的插件,可能会严重消耗内存。 == 更新插件 == 访问 [https://www.mozilla.org/plugincheck 插件检查页面] 可以确认您的插件是否都是最新版本。 == 禁用消耗内存的插件 == 要确定 Firefox 内存消耗严重的原因是否来自某个插件,您可以试着有选择性地禁用一些插件: {for not fx23} # [[T:Open Add-ons|type=Plugins]] # 点击选择列表中的一个插件,点击 {button 禁用} 按钮以禁用它。 # 对其他您想禁用的插件进行同样的操作。 {/for} {for fx23} # [[T:Open Add-ons|type=Plugins]] # 点击选择列表中的一个插件,选择 {button 永不启用} 以禁用它。 # 对其他您想禁用的插件进行同样的操作。 {/for} 禁用一些插件后,退出并重新启动 Firefox,然后关注一下内存占用。如果没有明显改善,则可以重新启用这些刚才禁用的插件,再试着禁用另一组。 如果禁用某个插件后内存占用有明显改善,您可以保持禁用它。如果您经常使用此插件所以无法禁用,可以试着寻找更好的替代插件。 {for not fx19} * 请参阅 [[View PDF files in Firefox without downloading them]],其中提供了替代 [[Use the Adobe Reader plugin to view or download PDF files|Adobe Reader]] 查看 PDF 文件的方法。 {/for} == 检查 Flash 硬件加速状态 == 一些用于播放视频的插件,比如 Flash,可以使用硬件加速渲染全屏内容。通过使用显存可以减少内存使用。 # 导航到一个显示 Flash 视频的页面。 # [[T:contextmenu]]视频播放器,然后点击上下文菜单中的 {menu 设置...} 菜单。 # 点击 Adobe Flash Player 设置窗口左下角的图标打开 显示 面板。 # 确认已勾选 '''启用硬件加速''' 。 # 点击 {button 关闭} 按钮关闭 Adobe Flash Player 设置窗口。 = 检查 Firefox 硬件加速状态 = Firefox 硬件加速可以通过使用显存减少内存使用。 * 确认硬件加速已 [[Settings for network, updates and encryption#w_browsing|启用]]并且[[Upgrade your graphics drivers to use hardware acceleration and WebGL|正在使用最新版本的显卡驱动]]。 = 重新启动 Firefox = Firefox 的内存使用可能会随着开启时间而增加。一个折衷的方法是定期重启一下 Firefox。您可以设置让 Firefox 记住您的标签页和窗口,以便在重启后回到之前的状态。请查阅[[Session Restore]]以了解详情。 = 减少打开的标签数 = 每个标签页都要消耗一定的内存来显示网页。如果您总是打开'''超过 100 个标签页'''的话,您可以考虑是否换一种更轻便的方式来组织您要浏览的页面和要完成的任务,例如: * [[Bookmarks|书签]]。''提示:“[[Tabbed Browsing#Bookmarks and Tabbed Browsing|将所有标签页加入书签]]”可以一次性添加一批标签页到书签。'' * [http://lifehacker.com/378062/five-best-gtd-applications 任务列表类应用]。 = 其它使用大量内存的程序 = 打开许多程序会导致您的计算机和程序运行缓慢。关闭一些您不需要的程序可以释放内存。 = 手动修正 Firefox 同步扩展错误 = 由于中国大陆的特殊网络情况,Firefox 在同步某些数据的时候可能出现错误,导致占用过多。 遇到这种情况,您没必要舍弃如此优秀的同步功能,只要按照以下步骤操作一下即可: # 打开[https://support.mozilla.org/zh-CN/kb/用户配置文件#w_nadalioanunaoeeenieulgiiki-ka 用户配置文件夹]。 # 找到 {filepath 用户配置文件夹/weave/addonsreconciler.json} 文件。 # 按 {key Shift+Delete} 将该文件删除。 {note}该文件是同步附加组件时生成的临时文件。某些附加组件可能会出错,导致这个文件变大,在同步的时候会占用很多资源。删除后,下次同步时会自动生成一个干净的文件,'''干净的文件不会有较大占用'''。{/note} = 内存诊断工具 = * Firefox: ** '''about:memory''' 页面可以使您方便的发现由网页、扩展或者主题引发内存占用问题,有时页面上的 {button 最小化内存占用} 按钮可以使您立即减少 Firefox 的内存占用。 ** [https://addons.mozilla.org/firefox/addon/ramback RAMBack] 可使您释放 Firefox 的缓存,阻止由于缓存造成的内存泄漏。<br><br>如果您是一名 C++ 开发者,您还可以尝试 [https://wiki.mozilla.org/Performance:Leak_Tools Firefox 开发者用于调试内存泄漏的工具]。 {for winxp} * 系统: ** 使用任务管理器查看内存使用。访问微软支持网站上的 [http://support.microsoft.com/kb/323527/zh-cn 如何在 Windows 2000 中使用 Windows 任务管理器],阅读 ''如何监视计算机的性能'' 一节,以了解关于性能选项卡的详细信息。 {/for} {for win7} * 系统: ** 使用任务管理器查看内存使用。访问微软支持网站上的 [http://windows.microsoft.com/zh-cn/windows/see-details-computers-performance-task-manager 使用任务管理器查看有关计算机性能的详细信息],阅读 ''使用任务管理器查看有关计算机性能的详细信息'' 一节,以了解关于性能选项卡的详细信息。 {/for} {for win8} * 系统: ** 使用任务管理器查看内存使用。 <!-- 链接已死,找不到替代链接 --> {/for} = 增加内存 = 如果经过以上的尝试,您的 Firefox 还是占用了几乎所有的内存,可能您需要为您的计算机添加更多的内存。内存虽然便宜却可以提供巨大的性能提升。 <!-- MZ credit --> <br/> <br/> '''''信息来源:[http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox Reducing memory usage - Firefox (mozillaZine KB)]''''' [[Template:ShareArticle|link=http://mzl.la/LnX4ca]]

Zurück zur Versionsgeschichte