為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How to limit memory usage per tab

more options

I have problem with webpages with buggy javascript in a few websites. Website consumes all available memory and start to use swap. Swap in my computer is very slow (non-flash) and the computer stops to respond. Only restart can help me. Computer has 6GB RAM but JS on opened site can consume more than 2GB!!! I want to have possibility to set maximum memory used by one tab of firefox (I know, the tab is separated process and it should be possible).

How to limit memory usage by one tab to 750MB (or other value, preferred by user)? Acceptable actions after trying to get more memory: - the JS can stop to work, - the tab will show that crashed, - the tab will be closed automatically, - require confirmation before allowing any more allocations.

How to set it in about:config?

If it is not possible, please report bug and propose other similar function that will fix this problem.

I have problem with webpages with buggy javascript in a few websites. Website consumes all available memory and start to use swap. Swap in my computer is very slow (non-flash) and the computer stops to respond. Only restart can help me. Computer has 6GB RAM but JS on opened site can consume more than 2GB!!! I want to have possibility to set maximum memory used by one tab of firefox (I know, the tab is separated process and it should be possible). How to limit memory usage by one tab to 750MB (or other value, preferred by user)? Acceptable actions after trying to get more memory: - the JS can stop to work, - the tab will show that crashed, - the tab will be closed automatically, - require confirmation before allowing any more allocations. How to set it in about:config? If it is not possible, please report bug and propose other similar function that will fix this problem.

所有回覆 (3)

more options

Hello User,

Adjusting the Content process limit in the Performance settings may help this issue. I'll list the instructions for you.

Click the menu button and select Options. In the General panel, go down to the Performance section and uncheck the box next to Use recommended performance settings. You will then be able to change the Content process limit. You can set between one and eight content processes. The default is eight. Having more content processes can improve performance when using multiple tabs but it will also use more memory. You can reduce the number of content processes if your computer is running out of memory.

more options

You can check the Firefox Task Manager (about:performance) and about:memory pages.

Start Firefox in Safe Mode to check if one of the extensions ("3-bar" menu button or Tools -> Add-ons -> Extensions) or if hardware acceleration or userChrome.css is causing the problem.

  • switch to the DEFAULT theme: "3-bar" menu button or Tools -> Add-ons -> Themes
  • do NOT click the "Refresh Firefox" button on the Safe Mode start window
more options

This doesn't solve my problem. The problem is BUGGY SCRIPT on web page. I know that I can identify the script and block it. But... it is not only one buggy script. I do not have problem with drawing processes (selection of 1 doesn't help me and I tried it before asking - I used "search" before asking). According userChrome.css, themes etc. The firefox is installed on NEW LAPTOP and there is no change according default settings... Firefox has standard configuration. Installation of ublock doesn't help me because this script is not an ads script.

I need real OOM option that limit RAM memory per process. I plan to try "cgroups" but I am newbie in Linux. The problem can be solved by developers if there is lack of this function. It is easy to implementation.

In the past I used 32-bit version of OS. It limited the tab to 2GB naturally (this site and other with buggy script crashed after 5 minutes naturally - OS RAM limit per process). At the moment I have 64-bit OS and I AM FRUSTRATED THAT I CANNOT LIMIT FIREFOX PROCESS (TAB) to 2GB (or preferred 750MB).

Unfortunately my laptop hasn't 32-bit EFI and hasn't BIOS LEGACY mode and I cannot easily install 32-bit version of Linux or Windows.

由 default.user 於 修改