Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:38:37+00:00 2026-06-09T17:38:37+00:00

I have a web page that starts a HTML5 SharedWorker script. Chrome memory usage

  • 0

I have a web page that starts a HTML5 SharedWorker script. Chrome memory usage increases every time this page is reloaded (hitting F5).

The worker script is very simple. Every second (using setInterval) a message is sent to the connected port.

It seems like the worker process is terminated and restarted each time I hit F5. This is what I’d expect since the worker isn’t actually shared by more than one ‘document’. However, I cannot figure out why memory usage increases on every refresh.

Does anybody know why this is happening?

Given that memory increases each time the page is reloaded makes me think that I cannot use shared workers at all in Chrome. Has anyone been able to do so without having memory problems?

UPDATE

This is the hosting HTML:

<div id="output"></div>
<script type="text/javascript" src="/scripts/jquery-1.4.4.js"></script>
<script type="text/javascript">
$(function () {
    var worker = new SharedWorker("/scripts/worker.js") 

    worker.port.onmessage = function(e) {
        $("#output").append($("<div></div>").text(e.data));
    }; 

    worker.port.start();
});
</script>

…and this is worker.js:

var list = [];

setInterval(function () {
    for (var i = 0; i < list.length; ++i) {
        list[i].postMessage("#connections = " + list.length);
    }
}, 1000);

onconnect = function (event) {
    list.push(event.ports[0]);
}; 

The hosting page starts/connects to a shared worker and outputs whatever is received from it.

The worker code keeps a list of connected ports and sends a message to them all once a second.

This is simple stuff. Yet, each time the hosting page is reloaded in Chrome. Memory payload for that tab is increased.

The following shows Chrome’s memory usage after a couple of refreshes:

After refreshing a couple of times I've reached 100 MB

…after refreshing some more I’m reaching 250 MB…

Reaching 250 MB after some more refreshing

I’m running out of ideas, thinking this must be a bug in Chrome. Can anyone give me some sort of pointer?

UPDATE 2

Disabling my AdBlock extension seemed to fix the problem:

Running without AdBlock

So I was happy for a little while but it turned out that memory is still being leaked. With AdBlock disabled it’s just leaking quite a bit less per page refresh.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:38:39+00:00Added an answer on June 9, 2026 at 5:38 pm

    Seems like the Chromium-team have resolved this problem. I cannot reproduce it anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page that consists of a checkbox (parent) and on this
I have a web-page that starts like so: <!DOCTYPE html> <html> <head> <!--[if lt
I have a webpage that, when you click start patrolling, starts counting the time
new on rails and using windows for now,, i have web page that user
I have web forms page that has 2 controls. A gridview and an associated
I have a web page that prompts for user input via DropDownLists in some
I have a web page that whenever your in a text-field, if you hit
I have a web page that I display in a WPF WebBrowser control within
I have a web page that displays a list of documents stored on the
I have a web page that is intended to be loaded on a person's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.