Forum Discussion

07_19's avatar
07_19
Iron Contributor
Apr 07, 2020
Solved

High CPU usage because of service worker (sw.js)

Since the last update, almost each time I close a tab, Edge starts to take a lot of CPU. 

In the browser task manager, I see that it's the service worker that cause this : it's written either "service worker " or I can see the url of the page I just close appended with a "sw.js"

 

This also happens when I open/close a new tab or even an extension (rss, password manager...)

 

I have disabled the setting : Allow recently closed sites to finish sending and receiving data (recommended) but this didn't change anything. 

 

Version 83.0.467.0 (Official build) dev (64-bit)
 

 

  • 07_19's avatar
    07_19
    Apr 09, 2020

    Since the new update (Version 83.0.474.0 (Official build) dev (64-bit) ), I don't have this bug anymore. 

  • Thraetaona's avatar
    Thraetaona
    Iron Contributor

    07_19 

     

    You could check edge://serviceworker-internals/ for a detailed list of active service workers.

     

    To (temporary) disable a service worker you could press 'F12' to open Devtools and navigate to the 'Application' Tab.  Under the 'Application' section there is an entry called 'Service Workers' in which you can unregister specific workers associated with certain sites.

     

    Beware that upon visiting the same sites new Service Workers could be installed again and some are able to run offline.

     

     

    To permanently prevent sites from installing service workers you could either disable cookies (Globally or just for a single site) or disable JavaScript completely, the latter may cause issues with most sites.

    • 07_19's avatar
      07_19
      Iron Contributor
      Thanks for this quick fix. Currently, each time there is a lag, after I close a tab or open/close an extension, I open the browser task manager and kill the task.

      By the way, do you know why this is happening since the last update? I never had anything like that before!
      • Thraetaona's avatar
        Thraetaona
        Iron Contributor
        You're welcome,

        Not sure; since I don't have the same problem on canary; it could still be an issue with a specific site or extension?

        To test weather the recent update has been causing the issue, you could (1) remove all extensions, (2) unregister all service workers through Devtools and (3) clear your browser's cache.
        Then try opening a site like google or this thread and closing them, see if they cause any lag spikes.

Resources