1

I use Firefox 83 on my Devuan GNU/Linux Beowulf desktop.

Unfortunately, for reasons which are not clear to me, FF has memory issues which cause it to gradually take up more and more of my system's memory. It's tolerable as long as I'm using the system, but when I leave it alone for several hours, I find it has swapped everything else out, and my system takes... oh, a good several minutes or so of disk I/O to get back into shape (usually after I've done killall firefox-bin in textual VT).

I've decided I want to hard-cap FF's physical and/or swap memory usage. I've read this post on ServerFault:

Limit memory usage for a single linux process

and there are lots of suggested ways to do this:

  • Wrap process execution with use of the uptime perl script
  • Define a memory-limited process control group (the cgroups mechanism), then wrap process execution with the use of cgexec
  • Use a complex cgroup-based wrapper script
  • Wrap process execution in a script which sets ulimit
  • Use a monit daemon to kill firefox under certain conditions (goes beyond a certain amount of memory while the machine is determined to be idle, although that might be difficult to detect (?))

But for the life of me I can't decide which one to try. Can I get some pros and cons of the different methods?

Notes:

  • Remember Firefox is already often launched by a wrapper script. Also, it launches child processes.
  • The machine is an Intel i5-7600K with 16 GB of physical RAM.
  • I do use some other significant memory-consumers occasionally (e.g. an in-memory DB I play with); but the machine is not a dedicated server or anything - just my desktop.
  • If you need more information about my usage profile, ask.
  • If you have another alternative to those listed above, you can add pros and cons for that too.
  • You can cover just one or two alternatives you have experience with, no need to discuss all options.
einpoklum
  • 9,515
  • This has been bothering me for a while too. I have an older system so I thought that was the issue, but sadly that may not be true after all. I've taken to restarting Firefox every few days or so to head off the problem, but I'd be interested in a better solution too. – Scott Weldon Mar 14 '21 at 22:48
  • Since it's not specifically stated, I'll ask for the benefit of other answerers: I assume that, like me, you only rarely restart Firefox / reboot your system? So it's not after a couple hours that this happens, but on the order of days or weeks? – Scott Weldon Mar 14 '21 at 22:52
  • 1
    @ScottWeldon: 1. Reboot my system? Why would I go and do something like that? 2. I frequently kill and restart firefox, because of this very issue. About once a day. Editing to clarify. – einpoklum Mar 14 '21 at 23:28
  • @ArtemS.Tashkinov: Is the downvote yours? – einpoklum Mar 15 '21 at 09:10

0 Answers0