Re: Dashboard Memory Leak

526 views
Skip to first unread message
Message has been deleted

matt

unread,
Sep 14, 2012, 4:49:48 PM9/14/12
to google-visua...@googlegroups.com
To be more specific on how to recreate:


Then at the very bottom of the javascript place the following code after the line "dashboard.draw(data);" you can recreate.

   dashboard.draw(data); //leave this line, the rest is new
  setTimeout(function ({drawChart(dashboarddata);}500);
}

function drawChart(dashboarddata{
  dashboard.draw(data)
  google.visualization.events.removeAllListeners(dashboard);
  setTimeout(function ({drawChart(dashboarddata);}500);
} 

asgallant

unread,
Sep 14, 2012, 5:07:48 PM9/14/12
to google-visua...@googlegroups.com
I copied your code but couldn't duplicate the problem in Chrome.

asgallant

unread,
Sep 14, 2012, 5:32:23 PM9/14/12
to google-visua...@googlegroups.com
Disregard that, I was looking at the wrong entry in the chrome task manager.  I did not see the issue with events, though (even if I comment out the removeAllListeners call).

Daniel LaLiberte

unread,
Dec 7, 2012, 11:48:31 PM12/7/12
to google-visua...@googlegroups.com
Thank you, Steven, Matt, and Steffen for reporting these memory leak issues.  After I have time to try to reproduce the problems, I'll post some bug reports and I expect we will try to address them with moderately high priority.  However, memory leaks can often be very tricky to figure out and fix, so we might end up suggesting workarounds.

dan   

On Wed, Dec 5, 2012 at 1:42 AM, Steven Carter <interne...@gmail.com> wrote:
I have been seeing the same behavior with the Gauge chart type.  I am using it for a dashboard and it is updated frequently from the server via a Socket.IO broadcast to all currently connected employees.  I don't believe this was happening before the most recent release so it may be a regression.

Here is my usage code  (I scrubbed it to be more generic, so it may not be perfectly syntactically correct but I was careful nonetheless):

google.load('visualization', '1', {packages:['gauge']});

function Gauge() {
    this.gauge = new google.visualization.Gauge(document.getElementById('m'));
    this.gaugeOptions = {
        min: 0,
        max: 200000,
        greenFrom: 0,
        greenTo: 100000,
        yellowFrom: 100000,
        yellowTo: 180000,
        redFrom: 180000,
        redTo: 200000,
        animation: {
            duration: 1000,
            easing: 'out'
        },
        majorTicks: ["0","","100,000","","200,000"],
        minorTicks: 5
        };
    this.data = google.visualization.arrayToDataTable([
        ['c1', 'c2', 'c3'],
        [0, 0, 0],
    ]);
    this.gauge.draw(this.mqData, this.gaugeOptions);
}

Gauge.prototype.draw = function() {
    this.gauge.draw(this.mqData, this.gaugeOptions);
}


// in main code
   gauge = new Gauge();
   socket.on('some_event', function(data){   // This is emitted about once a second.  After about an hour the Chrome tab crashes
        gauge.data.setCell(0, 0, parseInt(data.c1, 10));
        gauge.data.setCell(0, 1, parseInt(data.c2, 10));
        gauge.data.setCell(0, 2, parseInt(data.c3, 10));
        gauge.draw();
    });

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/N4zOQ0Z2TLgJ.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
dlaliberte@Google.com   562D 5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Daniel LaLiberte

unread,
Dec 10, 2012, 4:59:22 PM12/10/12
to google-visua...@googlegroups.com
I wrote up a working example of Steven's Guage chart memory leak: http://jsfiddle.net/dlaliberte/xdus3/
On Linux in Chrome, I see the memory increase incrementally, and then drop way down periodically.  So I am not necessarily seeing a leak yet.  

Memory leaks are typically very browser specific, and can be operating specific, so you should specify the details of your environment.  Thanks.

dan
dan   


To post to this group, send email to google-visualization-api@googlegroups.com.
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Steven Carter

unread,
Jan 22, 2013, 11:49:19 AM1/22/13
to google-visua...@googlegroups.com
Sorry for the long delay in my response.  I'm on a 64 bit 13" MacBook Pro late 2011 model running OSX 10.8 using Chrome 26.0.1386.0 dev.  The issue has existed on each dev release since I have reported this issue.  After a few minutes of my dashboard gauges running (I have three of them on the page) I get the "He's dead, Jim!" screen.
dan   


To post to this group, send email to google-visua...@googlegroups.com.

To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
dlali...@Google.com   562D 5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

Daniel LaLiberte

unread,
Jan 22, 2013, 1:33:15 PM1/22/13
to google-visua...@googlegroups.com
Hi Steven,

Thanks for following up on this.  I am curious if you see the memory leak on the jsfiddle example I put together: http://jsfiddle.net/dlaliberte/xdus3/
If so, that will help me narrow it down, if I can try it on a platform that is similar to yours.  Thanks.

dan


To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
dlaliberte@Google.com   562D 5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Steven Carter

unread,
Jan 22, 2013, 2:36:49 PM1/22/13
to google-visua...@googlegroups.com
I haven't seen the JSFiddle page error out after about 90 minutes of letting it run, so it's possible that my problem involves some other interaction that I removed for code simplicity.  The only two other pieces that interact with the widget are the sockets from Socket.IO and the graphs being embedded in a draggable/sortable widget that gets dynamically inserted into the DOM at initial page load.

While I haven't seen the page crash, I have seen the memory usage balloon in the Chrome Task Manager.  The original tab is up to 818 MB after 90 minutes and the second tab I opened is up to 215 MB after about 5 minutes.  I have yet to see that number drop down as you observed, so there may be a platform inconsistency here.  I'll test on my home Fedora installation when I leave work today to see if it's machine/OS dependent.

svante....@21st.se

unread,
Oct 25, 2013, 11:46:39 AM10/25/13
to google-visua...@googlegroups.com
Try the newer release candidate (1.1). Worked for me on AreaChart!
  • google.load('visualization', '1.1', {packages:['gauge']});
Reply all
Reply to author
Forward
0 new messages