On Thu, Mar 25, 2010 at 10:47 PM, Html5Coder <html5c
...@gmail.com> wrote:
> 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?
> --
> You received this message because you are subscribed to the Google Groups
> "Chromium HTML5" group.
> 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>
> .
> For more options, visit this group at
> http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.