back to article Chrome on, baby, don't fear The Reaper: Plugin sends CPU-hogging browser processes to hell where they belong

The US government may have trouble regulating Google – but one of its developers has come up with a way to rein in the Chocolate Factory's resource-hungry browser. David Flater, a computer scientist at Uncle Sam's National Institute for Standards and Technology (NIST), has created a Chrome extension for killing excessive …

  1. Barry Rueger

    The Great Suspender

    A similar product that stops unused tabs after a short period so that they don't consume resources. Works for me.

    GitHub: https://github.com/deanoemcke/thegreatsuspender/

    Or via the Chrome Extensions page.

  2. Chris G

    Full fat or skimmed

    Something similar would be useful for MS fat reduction and bloat removal on Windows updates. Some updates have more fat than entire OSs used to contain and I am sure a lot of it could do with a trim.

    1. A Non e-mouse Silver badge
      Unhappy

      Re: Full fat or skimmed

      I still wonder how operating systems have managed to balloon to gigabytes in size.

      1. Anonymous Coward
        Anonymous Coward

        Re: Full fat or skimmed

        I think it's a combination of DLLs that don't (more static than dynamic), shared libraries that don't and a long standing habit of ignoring efficient coding on the assumption that the user will buy faster hardware to run it on anyway.

        From a usability perspective, a lot of time is wasted on irrelevant crap - that you have to wait for a wordprocessor is IMHO a hardcore criminal waste of computer resources.

        This leads me to irritation 2: I cannot believe we need such a massive amount of computer power just to show a graphical environment, especially since most of the imaging is now handed off to a graphics card. We used to do that with a bloody Pentium, even WITh the floating point bug (sorry, jut wanted to rub that in again :) ).

        1. Peter2 Silver badge

          Re: Full fat or skimmed

          Try this at some point.

          Install a copy of an old MS OS. Win7, Vista, XP, 2k, 98, whatever. Watch how quickly it does everything.

          Now download and apply all of the patches. Watch the performance difference. A sceptic might think that Microsoft was deliberately screwing their old OS's to make the newer ones look better. Of course, one should never assume malice when incompetence can be an adequate explanation.

          1. Anonymous Coward
            Anonymous Coward

            Re: Full fat or skimmed

            Of course, one should never assume malice when incompetence can be an adequate explanation.

            We're talking about Microsoft. It's not unreasonable to assume that both are in play.

        2. bpfh

          Re: Full fat or skimmed

          As I’ve posted before, Win2k server, yep took some gig on disk but surgically removing a lot of Microsoft services services and features unneeded for WAMP, I got all services up and running to the GUI with less than 32 meg of ram.

          I still have a ‘when I have time’ project to make a win10 VM and start doing the same to that - restoring a vm is far easier than the install and update cycle that lasts forever...

      2. rnturn

        Re: Full fat or skimmed

        Yup. I still recall how lean and mean a basic VMS installation could be (w/o any layered products). It easily fit on a 2GB drive using, maybe, 500MB.

      3. Blackjack Silver badge

        Re: Full fat or skimmed

        Bloattware and spyware mostly. You can still get a Linux up to date desktop version working with way less space Windows 10 uses.

      4. ThomH

        Re: Full fat or skimmed

        I'm not sure that's an operating-system-specific comment.

        I have a project that's about ~60,000 lines in total. With the latest Clang, all optimisations turned up to the appropriate maximum, the binary it produces is 21,595,120 bytes in size.

        I comment to a ridiculous volume, and write for legibility, avoiding code-golf-esque monstrosities, so suffice to say that the implied 360 bytes per line is somewhat of a surprise.

        It's C++ but I'll use a template only when there's actually some generic behaviour to describe. At one of my previous workplaces I knew somebody who seemed to believe in templates to allow completely different code paths for almost all runtime selection — anything you'd normally pass to a constructor by value he'd try to work into the template directly. "For performance", obviously.

        One of his ~30,000 line projects could no longer be built for 32-bit targets because the binary it produced was larger than 4gb.

        1. Long John Brass
          Mushroom

          Re: Full fat or skimmed

          I remember years ago talking (e-mail) with one of the KDE devs (Kde3?). Parts of the system were gobbling up huge amounts of RAM (for the time)

          He mentioned that one of the problems is C++ and the way it has to build the VirtualTable crap for each and every class function/method pointer; This leads to the VTable blowing out to HUGE dimensions.

          So for even relatively simple libraries you end up in this O^2 situation as each library loads for each thread. It's not that the library has to load twice or more(It's a shared page); it's that it has to build a unique set of VTables each time for each thread. This means the the VTables ended up many time the size of the code itself

      5. Fungus Bob
        Boffin

        Re: Full fat or skimmed

        "I still wonder how operating systems have managed to balloon to gigabytes in size."

        Bug bites. There is immediate swelling in the affected area.

        1. Fred Flintstone Gold badge
          Pint

          Re: Full fat or skimmed

          Love it :)

  3. Blockchain commentard

    And it even works on Chromebooks - 1st time I've seen CPU usage.

    1. NATTtrash

      1st time I've seen CPU usage

      Really? Can't you do a conky-like thing on a Chromebook? Just asking, have no personal experience with Chromebooks. Too cloudy for my workflow...

      As for the Reaper... Isn't uMatrix available for Chrome? I mean, if you want a good method to reduce browser CPU load, that excellent piece of code is one of the ways to do it effectively.

  4. Anonymous Coward
    Anonymous Coward

    How about

    An extension that automatically kills Chrome anytime it violates your priva

    1. TeeCee Gold badge
      Facepalm

      Re: How about

      I have that, it's a zero impact thing I call "not using Chrome".

    2. IGotOut Silver badge

      Re: How about

      No point, it would never launch

  5. Anonymous Coward
    Anonymous Coward

    At least it uses processes

    It took a while for the wheel to go full circle but finally browser developers caught the cluetrain and realised that having each tab or window simply as a seperate thread is bad news when it crashes and takes down the entire browser, so went back to using multiple processes as was done back in the day. How that works in Windows with its crippled process model and no support for fork() or similar niceties is anyones guess but at least its happening now which means you don't even need an extension - just use ps or top to monitor browser processes and kill them individually if theres a problem.

    1. steviebuk Silver badge

      Re: At least it uses processes

      I believe Chrome runs as a broker service and then all the tabs run under that. So if you look in Process Explorer each tab is an instance of Chrome each with it's own PID.

    2. Michael Wojcik Silver badge

      Re: At least it uses processes

      How that works in Windows with its crippled process model and no support for fork() or similar niceties

      I'm not a particular fan of the Windows process model (though thread security tokens, for example, were arguably a good idea), and Windows processes are very heavy. As someone who routinely develops on both Windows and UNIXy platforms (and has worked on a variety of others), I often miss the relative elegance and performance of UNIX when I work with Windows.1

      However, since XP, Windows has made it relatively straightforward to schedule work in a pool of preexisting child processes using CreateRemoteThread(Ex), which is quite fast. So the worker processes can be started ahead of time (with the pool expanding and contracting as needed), amortizing the process startup cost.

      There's an obvious security concern with CreateRemoteThread, compounded by Microsoft's braindead treatment of process-handle privileges - to watch for the termination of another process, for example, you need the same privilege as you'd need to invoke CreateRemoteThread on it, so there's no safe way to permit only the monitoring of another process. And its use obviously requires care. But as a fast IPC mechanism for related processes it can work pretty well.

      1Of course, in the days before demand paging and COW, UNIX fork() wasn't exactly ideal either.

  6. Anonymous Coward
    Anonymous Coward

    Is this Chromium or Chrome?

    Hang on, is this an issue with Chromium, which could affect a lot of derivatives, or is it just a problem with Chrome, which is Chromium + Google's add-ons, and which is the one variant you want to avoid anyway?

    1. MJB7

      Re: Is this Chromium or Chrome?

      It's an issue for any browser running javascript. I presume the extension will work on any Chromium variant, Firefox/IE/old Edge/Safari - not so much. (Don't know about the new Edge that runs webkit).

      1. doublelayer Silver badge

        Re: Is this Chromium or Chrome?

        It's the new edge that uses chromium. Old edge used its own renderer. The only thing using WebKit was Edge for IOS, which nobody ever really used anyway. So this could probably run in edge as well.

      2. Michael Wojcik Silver badge

        Re: Is this Chromium or Chrome?

        It's an issue for any browser running javascript

        Right, unless the browser takes steps to limit the resources consumed by the scripting engine. And I don't know offhand of any that do, because Users Would Complain.

        The ECMAScript standard would have done well to adopt some sort of resource limitation mechanism, possibly along the lines of POSIX setrusage or Chez Scheme's engines. Browsers could suspend scripts when they hit limits, then prompt users to grant more resources; with a whitelisting mechanism that could work fairly well.

        Of course many technical users run something like NoScript, but even that is a pretty coarse mechanism. (I'm always annoyed that NoScript can't temporarily whitelist scripts just for a tab or site, so when I run into some idiotic site that requires, say, Google Tag Services to function, and I have a compelling reason to use it anyway, I could just temporarily whitelist it for that tab only. Instead I have to fire up another browser instance to prevent every damn tab in the world from loading it.)

    2. rnturn

      Re: Is this Chromium or Chrome?

      In my experience, it's a Chromium thing. I have been using Opera before and after the switch to the Chromium engine and have noticed the new Chromium-based Opera was just as resource hungry as Chrome was before I stopped using it. Even The Great Suspender wasn't helping all that much with Chrome's appetite for resources; haven't tried it with New Opera.

  7. Anonymous Coward
    Anonymous Coward

    Firefox next ?

    FF is my non-Chrome browser of choice, but it has some nasty habits. I like to have 6 or 7 tabs open at a time, and just leave the browser there. Even with adblock/noscript, after a few hours some tabs (Facebook, BBC) just start to use a little more CPU - and a little more - and a little more,. until it's actually quicker to power cycle and restart (3 minutes) than wait for whatever it is to stop (over 10 minutes once ... which I know because the clock freezes).

    This is under Linux Mint, too ....

    1. jelabarre59

      Re: Firefox next ?

      FF is my non-Chrome browser of choice, but it has some nasty habits...

      I've had the same with Waterfox (Linux Mint as well). Seems the rule of thumb is that **ALL** modern browsers suck, and only differ in the particular flavour of their suckiness.

      1. eldel

        Re: Firefox next ?

        I would make a shout-out for pi-hole at this point. Latest versions of FF and Chrome on Mint - since I spooled up pi-hole at the weekend it's been blocking 60% of requests (and this is with umatrix running) and the footprints in both instances have not increased. At least not appreciably - whereas in 72 hours I would expect to see it. Might be worth a look.

    2. Anonymous Coward
      Anonymous Coward

      Re: Firefox next ?

      "This is under Linux Mint, too ...."

      You might find that this may be caused by some firefox addons or shared libraries in older versions of Linux Mint.

      They worked in conjunction with the default search engine (Yahoo).

      It was a mess!

    3. Anonymous Coward
      Anonymous Coward

      Re: Firefox next ?

      Funny enough I'd left Edge open overnight with 3 basic office365 tabs open (doing nothing). In the morning the 8GB PC had no memory left and edge was showing 3.5GB used.

      Very difficult to shut it down. Chrome was also running with about 40 tabs open but less than 1GB of memory used.

    4. Anonymous Coward
      Anonymous Coward

      Re: Firefox next ?

      Even with adblock/noscript, after a few hours some tabs (Facebook, BBC) just start to use a little more

      You might want to close that and other resource heavy websites after you're done.

      None resource heavy website (ex:El Reg) can be kept open for as long as you want without using up all your resources.

    5. Michael Wojcik Silver badge

      Re: Firefox next ?

      This is under Linux Mint, too ....

      You do know that Linux has POSIX limits (setrusage / ulimit), right?

      If you start the initial Firefox process with reduced CPU limits, the kernel will kill it or any of its children for you when they hit the limit. No need to reboot the whole machine.

      man ulimit.

  8. tony2heads

    Ancient history

    Worked in the Netherlands on a VAX environment where someone wrote a program called 'Magere Hein' (local nickname for the Grim Reaper) which killed of processes that seemed to nothing for long periods of time. Exceptions could be made, but you had to justify them

    It forced you to save your stuff.

  9. jelabarre59

    Or alternatively

    Not using Chrome and it's mentally deficient siblings usually works for me...

    1. Ken Hagan Gold badge

      Re: Or alternatively

      Exactly. Firefox has NoScript, which stops the problem happening in the first place, and you can whitelist sites that are well-behaved.

      That appears to be a simpler and more reliable way of achieving the results described with this extension.

  10. DerekCurrie
    Go

    √ Verified to work with Chrome, Chromium and Brave

    I've successfully installed and am running Reaper in Chrome, Chromium and Brave. I'm won't be testing other Chromium variants (such as Opera). But I expect it is safe to assume Reaper installs and runs fine with them as well. Go for it!

    NOTE: With Brave you have to change the command "chrome://***" to "brave://***" when setting up and installing Reaper. The regular "chrome://" command works fine with both Chrome and Chromium.

    Thank you NIST! If only the rest of my US government paid heed to your computer security recommendations!

  11. JDX Gold badge

    I thought chrome restricted non-visible tabs already? Certainly some rich web-sites only load when they are active... I've made the mistake of knowing a site takes a while to load, and switching tabs while I wait, only to realise it just stopped until I returned.

  12. Milo Tsukroff
    Flame

    There's another way to make code run efficiently ...

    ... give all the developers old, slow PC's for writing software on. The trouble with developers is that they all seem to run computers that are state-of-the-art and screaming fast, nothing like the laptops a lot of their customers are running. In the real world, Windows PC's are 3 years old, underpowered, patched and patched and overpatched, running anti-virus live scanning that takes up to 85% CPU under 'normal' circumstances, and since we have to get real work done, on top of all that we have to run a word processor, a spreadsheet, email software, and on and on. It's no wonder that code that looks so nice on a developer's shiny new workstation, running all by itself, ends up dogging my system. I spend quite a bit of time just watching stuff crawl along in Task Manager, as the CPU stays pegged at 99% utilization. All 4 cores, at that.

    1. IGotOut Silver badge

      Re: There's another way to make code run efficiently ...

      Did you know, that's pretty much what the makers of the game MDK did back in the day. They designed the game then tested it on old hardware, and tweaked it over and over until it ran well on that kit.

      These days, if the software runs slow,they expect you to fork out for better hardware, rather than clear out the unused crap.

    2. Ken Hagan Gold badge

      Re: There's another way to make code run efficiently ...

      It's even easier than that. You give them old, slow PCs for *testing* software on. They can use the shiny new box for writing it. I don't mind that. What matters is that the separate "test PC" that they deploy to for, er, "testing" should be similar to the target customers' boxes.

      (For all the non-developers out there I should point out that any developer who doesn't have a completely separate test system that they can strip down, rebuild and general hack about with to their heart's content to explore various test scenarios ... basically isn't a real developer. They're a script kiddie being indulged by HR with a fancy job title.)

    3. Anonymous Coward
      Anonymous Coward

      Re: Games Devs.

      I also like Indie games devs for games that take 5 years to release.

      The "Easy" mode is impossible to beat. Well, what do you expect of balance, when someone has had 5 years to train themselves and only the most hardcore Alpha/Beta testers to give them advice on balance?

      Seen it happen so many times.

    4. Michael Wojcik Silver badge

      Re: There's another way to make code run efficiently ...

      give all the developers old, slow PC's for writing software on

      We have a similar technique: Give the developers new laptops, but put Windows 10, Visual Studio, and McAfee on them. Slows them right the hell down.

      My 1-year-old Dell Latitude something-or-other is noticeably slower at running the same builds as my 5-year-old Latitude. The 1-year-old has a faster CPU and an SSD, but the older one is running Win7 and Symantec (as useless as McAfee, but does nothing useful faster). The difference is significant - typically around 15%, which means at least a few minutes for the build in question.

      The new one does run Linux in a VM somewhat more sprightly than the old one does, so it's not a hardware problem.

  13. steviebuk Silver badge

    Odd

    The zip file on Windows 10 & Windows 7 is showing as invalid and empty. Something happened to this already?

    1. DJV Silver badge

      Re: Odd

      Just tried it - no problems found. Are you using the built-in Windows zip program? If so, then try a decent one instead like 7-zip (which is what I used).

  14. fredesmite
    WTF?

    I'd like to know what it consumes 30% of of CPU

    I have a 8-CPU . 16G laptop running Linux CentOS7 .

    and Chrome will consume 70% of memory over days ; and idles at 30% CPU even when I'm not doing any browsing

    I see 20+ children threads running

    WTF is it doing ?

    1. Michael Wojcik Silver badge

      Re: I'd like to know what it consumes 30% of of CPU

      Spying.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like