SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-1287715%22%20slang%3D%22en-US%22%3EHigh%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1287715%22%20slang%3D%22en-US%22%3E%3CP%3ESince%20the%20last%20update%2C%20almost%20each%20time%20I%20close%20a%20tab%2C%20Edge%20starts%20to%20take%20a%20lot%20of%20CPU.%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20browser%20task%20manager%2C%20I%20see%20that%20it's%20the%20service%20worker%20that%20cause%20this%20%3A%20it's%20written%20either%20%22service%20worker%20%22%20or%20I%20can%20see%20the%20url%20of%20the%20page%20I%20just%20close%20appended%20with%20a%26nbsp%3B%22sw.js%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20also%20happens%20when%20I%20open%2Fclose%20a%20new%20tab%20or%20even%20an%20extension%20(rss%2C%20password%20manager...)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20disabled%20the%20setting%20%3A%20Allow%20recently%20closed%20sites%20to%20finish%20sending%20and%20receiving%20data%20(recommended)%20but%20this%20didn't%20change%20anything.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%20class%3D%22c01290%20c01291%22%3E%3CDIV%20class%3D%22c01295%22%3E%3CSPAN%20class%3D%22c01298%22%3EVersion%2083.0.467.0%20(Official%20build)%20dev%20(64-bit)%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22c01288%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1287849%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1287849%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388976%22%20target%3D%22_blank%22%3E%4007_19%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20check%26nbsp%3B%3CA%20title%3D%22If%20it%20doesn't%20work%20try%20manually%20writing%20it%20in%20the%20search%20box%22%20href%3D%22edge%3A%2F%2Fserviceworker-internals%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eedge%3A%2F%2Fserviceworker-internals%2F%3C%2FA%3E%26nbsp%3Bfor%20a%20detailed%20list%20of%20active%20service%20workers.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20(%3CSTRONG%3Etemporary%3C%2FSTRONG%3E)%20disable%20a%20service%20worker%20you%20could%20press%20'F12'%20to%20open%20Devtools%20and%20navigate%20to%20the%20'%3CEM%3EApplication%3C%2FEM%3E'%20Tab.%26nbsp%3B%20Under%20the%20'%3CEM%3EApplication%3C%2FEM%3E'%20section%20there%20is%20an%20entry%20called%20'%3CEM%3EService%20Workers%3C%2FEM%3E'%20in%20which%20you%20can%20unregister%20specific%20workers%20associated%20with%20certain%20sites.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBeware%20that%20upon%20visiting%20the%20same%20sites%20new%20Service%20Workers%20could%20be%20installed%20again%20and%20some%20are%20able%20to%20run%20offline.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20permanently%20prevent%20sites%20from%20installing%20service%20workers%20you%20could%20either%20disable%20cookies%20(Globally%20or%20just%20for%20a%20single%20site)%20or%20disable%20JavaScript%20completely%2C%20the%20latter%20may%20cause%20issues%20with%20most%20sites.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1288746%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1288746%22%20slang%3D%22en-US%22%3EIs%20it%20on%20Mac%20or%20Windows%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1289028%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1289028%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F310193%22%20target%3D%22_blank%22%3E%40HotCakeX%3C%2FA%3E%26nbsp%3B%2C%20Windows%2010%20version%201909%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1289033%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1289033%22%20slang%3D%22en-US%22%3EThanks%20for%20this%20quick%20fix.%20Currently%2C%20each%20time%20there%20is%20a%20lag%2C%20after%20I%20close%20a%20tab%20or%20open%2Fclose%20an%20extension%2C%20I%20open%20the%20browser%20task%20manager%20and%20kill%20the%20task.%3CBR%20%2F%3E%3CBR%20%2F%3EBy%20the%20way%2C%20do%20you%20know%20why%20this%20is%20happening%20since%20the%20last%20update%3F%20I%20never%20had%20anything%20like%20that%20before!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1289068%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1289068%22%20slang%3D%22en-US%22%3EYou're%20welcome%2C%3CBR%20%2F%3E%3CBR%20%2F%3ENot%20sure%3B%20since%20I%20don't%20have%20the%20same%20problem%20on%20canary%3B%20it%20could%20still%20be%20an%20issue%20with%20a%20specific%20site%20or%20extension%3F%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20test%20weather%20the%20recent%20update%20has%20been%20causing%20the%20issue%2C%20you%20could%20(1)%20remove%20all%20extensions%2C%20(2)%20unregister%20all%20service%20workers%20through%20Devtools%20and%20(3)%20clear%20your%20browser's%20cache.%3CBR%20%2F%3EThen%20try%20opening%20a%20site%20like%20google%20or%20this%20thread%20and%20closing%20them%2C%20see%20if%20they%20cause%20any%20lag%20spikes.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1296596%22%20slang%3D%22en-US%22%3ERe%3A%20High%20CPU%20usage%20because%20of%20service%20worker%20(sw.js)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1296596%22%20slang%3D%22en-US%22%3E%3CP%3ESince%20the%20new%20update%20(%3CSPAN%3EVersion%2083.0.474.0%20(Official%20build)%20dev%20(64-bit)%20)%2C%20I%20don't%20have%20this%20bug%20anymore.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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)
 

 

6 Replies
Highlighted

@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.

Highlighted
Is it on Mac or Windows?
Highlighted

@HotCakeX , Windows 10 version 1909

Highlighted
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!
Highlighted
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.
Highlighted
Best Response confirmed by 07_19 (Contributor)
Solution

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