Chrome to skip low priority tasks until shutdown to reduce memory use

Martin Brinkmann
Feb 11, 2019
Google Chrome
|
21

Google is working on a new memory reducing feature for the company's Chrome web browser. The new function, called "Skip best effort tasks" landed in Chrome Canary just recently; it is designed to skip certain low priority tasks during runtime to improve memory use of the web browser. The skipped tasks will be executed during shutdown instead, according to the provided description.

Skip best effort tasks is not enabled by default in Chrome Canary. It is available as an experimental flag and a startup parameter; which of the two you use is up to you.

Here is how you enable the flag in Chrome:

  1. Make sure Chrome Canary is up to date.
  2. Load chrome://flags/#disable-best-effort-tasks in the browser's address bar; doing so should open the right flag.
  3. Set the status of the flag to enabled.
  4. Restart the Chrome browser.

You may also start Chrome with the parameter --disable-best-effort-tasks for the same effect.

chrome skip best effort tasks

You can undo the change at any time by setting the experimental flag to default or disabled, or by removing the startup parameter if you used it.

Chrome informs you that you run an "unsupported command line flag and that stability and security "will suffer" because of that. I did not notice any issues while running Chrome with the flag enabled though; it is possible that the notification is a generic one.

The flag's description reads:

With this flag on, tasks of the lowest priority will not be executed until shutdown. The queue of low priority tasks can increase memory usage.Also, while it should be possible to use Chrome almost normally with this flag, it is expected that some non-visible operations such as writing user data to disk, cleaning caches, reporting metrics or updating components won't be performed until shutdown.

The description explains what is happening when you enable the experimental feature. Chrome maintains a queue of low priority tasks by default; the queue may grow over time and that may lead to increased memory usage.

Chrome with the experimental flag enabled won't execute these low priority tasks during runtime to save memory. The tasks will be executed during shutdown instead; this may lead to a delayed shutdown.

Google mentions Telemetry, disk cache cleaning, writing user data to disk, or updating components as low priority tasks.

The new effort to reduce Chrome's memory usage is not the only one that came to light recently. Google is working on a feature called Never Slow Mode that aims to limit resource requests by blocking those that exceed certain size restrictions.

Now You: What is the most memory friendly browser currently? (via Chromestory)

Summary
Chrome to skip low priority tasks until shutdown to reduce memory use
Article Name
Chrome to skip low priority tasks until shutdown to reduce memory use
Description
Google is working on a new memory reducing feature for the company's Chrome web browser that skips certain tasks during shutdown.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Previous Post: «
Next Post: «

Comments

  1. t said on April 25, 2019 at 2:17 am
    Reply

    Thank you for your advice, you were absolutely correct, it has been fixed!

  2. Anonymous said on April 24, 2019 at 8:01 pm
    Reply

    Thanks for your help!

  3. T said on April 24, 2019 at 7:00 pm
    Reply

    Hello, I enabled the flag as you suggested .
    Now when I open Canary version 76.0.3775 I get that message that you said would be there .
    Canary immediately closes.
    I can not open chrome flags to disable.
    I tried restarting windows 10 & reinstalling Canary.
    Still won’t stay open.
    As an old man in his 70’s I am at a loss.
    Any thoughts? Thanks

    1. Martin Brinkmann said on April 24, 2019 at 7:19 pm
      Reply

      This may be unrelated. I have another Chrome Canary version here without the flag that closes immediately. Canary is the cutting edge version, it is probably a bug. Wait until the next version and see if it fixes it.

      1. T said on April 24, 2019 at 7:50 pm
        Reply

        Hello,
        Thank you for responding so quickly!
        I will try and wait.
        I have used Canary for 5 years and it is fun even though there are issues!

  4. ULBoom said on February 12, 2019 at 8:47 pm
    Reply

    Chrome and Chromium are not the same thing and the names can’t be used interchangeably. How this low priority thing matters, IDK, beyond increasing to the length of your entire session, the amount of time a task has to collect data. Maybe the effects are unnoticeable.

    I have an older non webRTC version of Chromium and just found cookies from ebay left over from 6 months ago even though the browser is set to delete such cookies. I had to manually go into settings, dig down to find this junk and delete it. FF never does this.

    Google calls Chrome browser based ad data collection software or something similar in their quarterly reports. Anything they do to chrome is related to taking data and serving ads; doing anything else would be bad management considering they’re an ad company. Microchrome Edge is next.

    As far as memory goes, my Chromium uses a bit less than FF (370 vs. 400 Megs) with only this site open in both but it’s woolyss chromium, a stripped version and has fewer add ons. What Chrome would consume, IDK, I would never use it.

  5. Anonymous said on February 12, 2019 at 5:28 am
    Reply

    With Chromium not exactly winning the world transparency championship, I’m going to presume that this article is entirely based on that flag’s description snippet. And my interpretation of that is a completely different one.

    > With this flag on, tasks of the lowest priority will not be executed until shutdown. The queue of low priority tasks can increase memory usage.

    This to me sounds as if it’s actually going to use more memory to have this feature enabled. If they want to execute these tasks at shutdown, they do need a queue for them somewhere.
    So, my interpretation of that snippet, is that this queue is in RAM and will gradually increase in size the longer you use Chrome without shutting it down.
    They could theoretically write that queue to disk, but it would still be a queue, so if that was the case, I would expect them to differentiate that in the snippet.

    The presumed benefit of this flag is that they don’t start doing a low priority task right before the user decides to continue browsing. Because if that happens, you pretty much get caught with your pants down.
    You then either have to finish the task and make the user wait for some hundred milliseconds. Or cancel right out of that task, but then you still need to get the data for the doing the browsing into the caches (which you had to replace in order to do that low priority task).

    Therefore putting a queue in RAM for these low-priority tasks and only doing them at shutdown increases responsiveness at the cost of using more RAM.

    I would also presume that they keep them in RAM and don’t write them to the hard drive, because writing to the hard drive would basically be such a low priority task in itself.

  6. Paul(us) said on February 12, 2019 at 12:50 am
    Reply

    Personly I am still convinced that Firefox is still the number 1 and even Vivaldi is doing response wise better than chrome ( But that’s only main personal opinion and I don’t know or this is true but it feels like its true!). Even when you use a quite an extensive set of comparable add-ons is Firefox, Vivaldi or Google Chrome.

    The question I have here is I use with chrome the program Fireman.
    Do you think there is still a need for Firewin when this tweak is integrated into the Chrome stable version?

  7. supergirl said on February 12, 2019 at 12:02 am
    Reply

    Wow…This is what happens when you legalize pot!

    When Im reading a web page here @ gHacks it takes anywhere from 1 minute to 10
    Depending on replies….

    That would be a good Time to ask/inform me of needed disk time.

    NOT when Im shutting down my Computer in a hurry because someone called me offering free FOOD!!

    at a restaurant yet,,not no Soup Kitchen this time…

    When Point & Click was becoming “a Thing.” I knew it was a bad idea..

    “So simple a child can do it.” ….And ‘THEY’ Have been treating us like children ever since.

    Always manipulating behind the scene…Tricks & Traps & tracking & worse.

    Just ask me….

    “Google would like to Upload a copy of everything on your computer &
    all tracking data offa your Phone…WE need 25 minutes is now a good time?”

    Then allow me to check..”maybe Later” ..So I dont feel so abused alla the time.
    After all its only my computer.My internet connection,
    & my tax dollars that Al used to invent the internets.

    For God’s sake…ASK ME!!!!!!!

    1. ULBoom said on February 12, 2019 at 7:36 pm
      Reply

      What?

    2. Anonymous said on February 12, 2019 at 4:28 pm
      Reply

      “Wow…This is what happens when you legalize pot!”
      “my tax dollars that Al used to invent the internets.”

      Are these your genuine opinions or are you just playing a role here ?

      1. supergirl said on February 16, 2019 at 5:45 am
        Reply

        @Anonymous
        “Are these your genuine opinions or are you just playing a role here ?”

        Hay!
        Are you “The REAL” Anonymous or are you just buttering my roll here…?
        :)

  8. Coriy said on February 11, 2019 at 8:26 pm
    Reply

    I’m not a programmer, but won’t waiting until shutdown to do such tasks as writing to disk, clearing caches, etc. actually slow it down at the end. Maybe not so much on most operating systems, but what about ChromeOS?
    I’d think the better time to do the low priority tasks would be during idle times rather than slowing shutdown.

    1. Anonymous said on February 12, 2019 at 7:39 am
      Reply

      My understanding of this feature differs from the article’s. I understand it as that it actually increases RAM usage. In order to do these jobs at shutdown, you have to keep a queue for them somewhere. And they’re gonna have to keep that queue in RAM, because writing it to the hard drive would be worthy of such a low priority task in itself.

      The point of this feature, as I imagine it, is to not be doing these tasks right when the user decides to click a link. In that moment, you would have to wait for that task to complete or cancel it, in which case you would still have to wait for the caches to have the data again that’s necessary for browsing (as it was replaced by the data necessary for that low priority task).

      So, it makes it feel more responsive at the cost of more RAM usage.

      Chrome using more RAM will slow other applications and your operating system down. If you run low on RAM, then yeah, it will also affect Chrome itself.

      Not writing data directly to the hard drive will use more RAM, if it does not keep that data in RAM anyways.

      Clea*n*ing caches means essentially the same thing. A “dirty” cache is a cache that has (changes to) data in it which hasn’t been written back to the hard drive yet. If Chrome would want to reuse that portion of cache and it hasn’t been cleaned (written back to the hard drive) yet, it will have to do that in the moment when it wants to reuse the cache, which will generally slow it down in exactly the wrong moment.

      But if they don’t intend to reuse that cache for other data (therefore keeping the same data in there all the time, while being allowed to continuously modifying that data), then it might be viable to not clean it.

      Drawbacks then would be that in the case of a crash, the data will be lost.
      And if the dirty cache is a cache near one of the CPU cores, then depending on the CPU architecture it might be either impossible or rather slow for another CPU core to take over that workload without cleaning the cache first up to a shared cache (don’t need to write it all the way to the hard drive, just into a cache that all cores can access without problems).

      And probably not even that are all possible implications. In order to optimize this, they will have to look at all the caches that they have, sort out those caches that they reuse with other data, then sort out those caches whose data is important to not lose during a crash, and then probably also just throw out all CPU-core-specific caches.

      Overall, I would categorize this as massive headache with arguable payoffs (it feels somewhat faster at the cost of somewhat more RAM usage), but that’s kind of the state of browser development, I guess. Tiny optimizations at high costs.

    2. Anonymous said on February 12, 2019 at 4:12 am
      Reply

      That’s why it’s experimental. They need to find out what action that needed to be on the low priority.

      I prefer the browser to write disk in the end than idle times. I don’t use Chrome but Firefox is quite heavy on the disk write. Try opening Firefox and leave it alone, then open the Resource Monitor. Somehow Firefox keeps writing something to the disk.

  9. clake said on February 11, 2019 at 7:25 pm
    Reply

    Trying out the iridium browser (chromium 71 based) today in win10. It is very miserly on memory so far, but no extensions installed yet. The ui is stock chromium – no frills.

  10. Yuliya said on February 11, 2019 at 5:33 pm
    Reply

    >Google mentions Telemetry as low priority task
    Nice to see that. Unlike in the moz://a land where they send additional addons to reinforce their telemetry, all this while bragging with every opportunity they have to care about user’s privacy.

    I like the idea. Chromium is already fast and a great browser, and if they lower its memory footprint, all the better! Long live Chromium!

    1. Anonymous said on February 12, 2019 at 4:50 am
      Reply

      You do understand that they have much bigger control over your browser’s behaviour by simply patching the binary through the auto-update feature, right?

      Doing experiments through extensions rather than patching the binary actually very much limits what Mozilla can do, and it helps with transparency, making it possible for users to figure out that Mozilla is doing experiments. You would never know, if Google would be doing a similar experiment on your system.

      Heck, when they presumably fucked up and patched the automatic downloading of the “OK, Google”-hotword-detection blob into Chromium, it took until some Debian tester noticed that it’s downloading something. No one had seen it in the code that they pushed to users, and Debian is even a distro that does relatively much work to ungoogle Chromium.

      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786909

      1. Anonymous said on February 12, 2019 at 4:15 pm
        Reply

        “You do understand that they have much bigger control over your browser’s behaviour by simply patching the binary through the auto-update feature, right?”

        Not obvious, updating extensions invisibly is easier than updating main code.

        However it’s true that Firefox proprietary parts cover less critical functions than Chrome proprietary parts, so that’s a reason why Firefox is easier to audit (which does no longer imply it will be purged of the discovered anti-features because you know, forks that don’t have half a billion dollars budget from Google et al will be defamed by the mothership as not being secure).

    2. Anonymous said on February 11, 2019 at 11:53 pm
      Reply

      This only means that the same telemetry data is sent later, not that less telemetry data is sent. The very fact that telemetry has enough impact on performance to deserve being delayed is a disturbing idea.

    3. user17843 said on February 11, 2019 at 9:51 pm
      Reply

      Well, when it comes to Firefox, it has become a hobby of mine to seize control of the browser, so they can’t just do stuff remotely all the time, like google analytics, blocking extensions, showing me ads, showing me more ads, showing me some strange pop-ups about extensions, other pop-ups about how to use a browser, changing the search engine, showing me news, etc.

      I do think at one point all of this adds up and decreases performance, although my main criticism is with the way Firefox seems to think I am dumb.

      Obviously the Chrome team uses telemetry for what it is supposed to be for, and even if only 20% of users have it enabled, it is already more than what they can productively work with.

      Firefox uses temeletry for what exactly? For guidance. They want to know everything and then they look into their crystal ball asking “What do we need to do now, wise data”, hoping the data tells them everything.

      —-

      Google knows there are two things that could seriously harm ther ad business:

      – Slow browsing due to bad websites
      – Slow browsing due to bad ads

      So they work on both problems to not create a mass exodus into ad blockers and competing browsers. They know about Brave, and if they don’t control the ad-experience and slow-loading sites they will lose users to them.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.