Compare Revisions

内存消耗严重

Revision 18639:

Revisión 18639 de kmc do

Revision 37399:

Revisión 37399 de decency8035 do

Palabras clave:

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

Search results summary:

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

Contido:

Firefox 有时内存使用过量。这会让 Firefox 变慢,极端的情况下甚至会引起崩溃。 一个电脑程序使用的内存量取决于多个因素,例如内存泄漏、与第三方程序的冲突或者使用者的行为习惯。本文讲述了如何让 Firefox 少用一些内存。 __TOC__ = 附加组件 = == 扩展与主题 == 扩展与主题可能使 Firefox 内存使用过量。 要确定 Firefox 内存消耗严重的原因是否来自扩展与主题,请用[[Safe Mode]]启动 Firefox,然后关注一下内存占用。在安全模式下,扩展与主题是禁用的,如果内存占用有明显好转,您可以试着禁用或卸载某些扩展或主题。 * 关于启动安全模式和查找扩展与主题问题的更多信息,请查阅[[Troubleshooting extensions and themes]]。 == 插件 == 用于显示特殊页面元素的插件,尤其是过时的旧版插件,可能会严重消耗内存。 要确定 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. --> 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 变慢,极端的情况下甚至会引起崩溃。本文将介绍如何让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/排查内存具体使用情况 通过addons-memory扩展来直接查看各个扩展和主题大致的扩展内存使用情况]。 == 插件 == 用于显示特殊页面元素的插件,尤其是过时的旧版插件,可能会严重消耗内存。 要确定 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. --> 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)]'''''

Volver ao historial