Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Active tab takes all available memory and then crashes

  • 3 个回答
  • 1 人有此问题
  • 2 次查看
  • 最后回复者为 jonzn4SUSE

more options

Greetings. I've got a problem which is ocсuring in firefox. I'm starting js script on the web page which creating some canvas elements and saving them as PNG files (do no add them into DOM). All created objects are changing their values to null after save to make them unreachable for GC. During this process Firefox is taking all available memory (it is not much, only 4 GB installed and around 3 Gb free) and then crashing with "out of memory" exception. I opened about:memory and clicked on the "Minimize memory usage" button. It took effect. GC freed unused memory and the script continuing working for some time. Then I had to minimize again. And again... till the end of script running.

But if I switch to another tab after starting the script (the tab with running script became inactive), memory consumption is not growing and limited about 100 MB. That is exactly what I need.

So, looks like GC is not working on active tab or working but not absolutely correctly. But it is working properly on inactive tab. I hope there are some preferences in firefox (about:config ? ) which can help me to solve this problem.

P.S. I've tried the same in chrome. It works fine. So, I believe then script is more or less correct. P.P.S. Sorry for my English. It is not my native language.

Greetings. I've got a problem which is ocсuring in firefox. I'm starting js script on the web page which creating some canvas elements and saving them as PNG files (do no add them into DOM). All created objects are changing their values to null after save to make them unreachable for GC. During this process Firefox is taking all available memory (it is not much, only 4 GB installed and around 3 Gb free) and then crashing with "out of memory" exception. I opened about:memory and clicked on the "Minimize memory usage" button. It took effect. GC freed unused memory and the script continuing working for some time. Then I had to minimize again. And again... till the end of script running. But if I switch to another tab after starting the script (the tab with running script became inactive), memory consumption is not growing and limited about 100 MB. That is exactly what I need. So, looks like GC is not working on active tab or working but not absolutely correctly. But it is working properly on inactive tab. I hope there are some preferences in firefox (about:config ? ) which can help me to solve this problem. P.S. I've tried the same in chrome. It works fine. So, I believe then script is more or less correct. P.P.S. Sorry for my English. It is not my native language.

所有回复 (3)

more options

Is there a reason for the old version of Firefox? I would use Firefox from Mozilla and see if you have the same issues. https://www.mozilla.org/en-US/firefox/all/#product-desktop-release

What distro are you using?

Also look at that strace example you can try from this issue. https://support.mozilla.org/en-US/questions/1366660

由jonzn4SUSE于修改

more options

Thank you your replay. I didn't expect it so soon.

I'm not privileged user on the client system. So, I can't run strace. On my developing station installed 16 GB of RAM and no problem with the script.

On the client system (4 GB of RAM) I tried two versions of firefox: 72 (installed from repository). It is debian-based distro made in company. When I've got this problem, I've decided to try newer version of firefox. I downloaded firefox 96.0.3 from mozilla web site. No success. The same behavior.

I found some parameters related to GC in about:config, but I can't find description of them. My idea is to change some settings which are influencing to a moment when GC will start. I'm not sure that it is possible. But I hope it is.

more options

May the Schwartz be with you.  ;-)