WebWorker consuming memory incrementing continually

841 views
Skip to first unread message

Html5Coder

unread,
Mar 26, 2010, 1:47:02 AM3/26/10
to Chromium HTML5
Hi,
I am writing some code to setup a basic webworker to test it.
I have a main html page that sets up the worker then the worker sends
back a timestamp to the main page.
This works, however the problem is that if you look at the chrome task
manager the memory for the webworker process continues to increment??
After a period of time when the memory gets large, the worker stops
responding.

Below is the code I am using:

WORKERTEST.HTM
<!DOCTYPE HTML>
<html>
<head>
<title>Worker example</title>
<script>
worker = new Worker('worker.js');
</script>
</head>
<body>
<div id="results">RESULT</div>
<script>
worker.onmessage = function (event) {
var data = event.data;
document.getElementById('results').innerHTML= data;
};
worker.postMessage();
</script>
</body>
</html>

WORKER.JS
onmessage = function (event) {
setInterval("run()",1);
}
function run(){
response=new Date().getTime();
postMessage(response);
}

Can any explain to me why the web worker continues to increase in
memory size while running?
Is this usual?

Drew Wilson

unread,
Mar 26, 2010, 5:02:22 PM3/26/10
to Html5Coder, Chromium HTML5
Resending using correct email address this time:

That's not an expected result - can you please log a bug for this at http://code.google.com/p/chromium/issues/list?

I'm not sure what's going on as there aren't any leaks that we're aware of in the code path you're executing - it sounds like perhaps GC is not happening.
If you increase the setInterval() period to something larger (like 100) does the leak still happen?

-atw


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.


Html5Coder

unread,
Mar 29, 2010, 2:34:56 AM3/29/10
to Chromium HTML5
Thanks, it does look like it is similar to other bugs related to GC
not happening as you suggested.
Have logged bug for this and waiting for response.
This occurs with any setInterval period, was set to 1 to show memory
leak happening quicker.
Thanks


On Mar 27, 8:02 am, Drew Wilson <atwil...@chromium.org> wrote:
> Resending using correct email address this time:
>

> That's not an expected result - can you please log a bug for this athttp://code.google.com/p/chromium/issues/list?

> > To post to this group, send email to chromium-ht...@chromium.org.


> > To unsubscribe from this group, send email to

> > chromium-html5+unsubscr...@chromium.org<chromium-html5%2Bunsubscr...@chromium.org>

Reply all
Reply to author
Forward
0 new messages