{"action":"created","issue":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/816","repository_url":"https://api.github.com/repos/chartjs/Chart.js","labels_url":"https://api.github.com/repos/chartjs/Chart.js/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/chartjs/Chart.js/issues/816/comments","events_url":"https://api.github.com/repos/chartjs/Chart.js/issues/816/events","html_url":"https://github.com/chartjs/Chart.js/issues/816","id":51873566,"number":816,"title":"Line Chart has memory leak","user":{"login":"Rondle","id":661250,"avatar_url":"https://avatars.githubusercontent.com/u/661250?v=3","gravatar_id":"","url":"https://api.github.com/users/Rondle","html_url":"https://github.com/Rondle","followers_url":"https://api.github.com/users/Rondle/followers","following_url":"https://api.github.com/users/Rondle/following{/other_user}","gists_url":"https://api.github.com/users/Rondle/gists{/gist_id}","starred_url":"https://api.github.com/users/Rondle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rondle/subscriptions","organizations_url":"https://api.github.com/users/Rondle/orgs","repos_url":"https://api.github.com/users/Rondle/repos","events_url":"https://api.github.com/users/Rondle/events{/privacy}","received_events_url":"https://api.github.com/users/Rondle/received_events","type":"User","site_admin":false},"labels":[{"id":32309884,"url":"https://api.github.com/repos/chartjs/Chart.js/labels/Category:%20Bug","name":"Category: Bug","color":"fc2929","default":false},{"id":344424274,"url":"https://api.github.com/repos/chartjs/Chart.js/labels/Priority:%20p2","name":"Priority: p2","color":"009800","default":false},{"id":253923670,"url":"https://api.github.com/repos/chartjs/Chart.js/labels/Version:%201.x","name":"Version: 1.x","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2014-12-13T02:32:19Z","updated_at":"2016-12-29T01:16:05Z","closed_at":"2016-04-03T00:54:37Z","body":"I ran into the same problem as other users where the line chart's memory was not being released after calling destroy().  I took the sample line chart code to illustrate this.  Simply call LoopIt() and watch the memory usage increase.\n\n<!doctype html>\n<html>\n    <head>\n        <title>Line Chart</title>\n        <script src=\"../Chart.js\"></script>\n    </head>\n    <body>\n        <div style=\"width:30%\">\n            <div>\n                <canvas id=\"canvas\" height=\"450\" width=\"600\"></canvas>\n            </div>\n        </div>\n\n```\n<script>\n    var randomScalingFactor = function(){ return 5};\n    var lineChartData = {\n        labels : [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\"],\n        datasets : [\n            {\n                label: \"My First dataset\",\n                fillColor : \"rgba(220,220,220,0.2)\",\n                strokeColor : \"rgba(220,220,220,1)\",\n                pointColor : \"rgba(220,220,220,1)\",\n                pointStrokeColor : \"#fff\",\n                pointHighlightFill : \"#fff\",\n                pointHighlightStroke : \"rgba(220,220,220,1)\",\n                data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n            },\n            {\n                label: \"My Second dataset\",\n                fillColor : \"rgba(151,187,205,0.2)\",\n                strokeColor : \"rgba(151,187,205,1)\",\n                pointColor : \"rgba(151,187,205,1)\",\n                pointStrokeColor : \"#fff\",\n                pointHighlightFill : \"#fff\",\n                pointHighlightStroke : \"rgba(151,187,205,1)\",\n                data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n            }\n        ]\n\n    }\n\nfunction Reload(){\n    var ctx = document.getElementById(\"canvas\").getContext(\"2d\");\n    window.myLine = new Chart(ctx).Line(lineChartData, {\n        responsive: true\n    });\n}\n\nfunction LoopIt(){\n    if(!window.myLine)\n        Reload();\n\n\n    for(var i = 0; i < 100; i++)\n    {  \n        myLine.destroy();\n        Reload();\n    }\n}\n\n\n</script>\n</body>\n```\n\n</html>\n"},"comment":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/comments/269567112","html_url":"https://github.com/chartjs/Chart.js/issues/816#issuecomment-269567112","issue_url":"https://api.github.com/repos/chartjs/Chart.js/issues/816","id":269567112,"user":{"login":"etimberg","id":6757853,"avatar_url":"https://avatars.githubusercontent.com/u/6757853?v=3","gravatar_id":"","url":"https://api.github.com/users/etimberg","html_url":"https://github.com/etimberg","followers_url":"https://api.github.com/users/etimberg/followers","following_url":"https://api.github.com/users/etimberg/following{/other_user}","gists_url":"https://api.github.com/users/etimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/etimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etimberg/subscriptions","organizations_url":"https://api.github.com/users/etimberg/orgs","repos_url":"https://api.github.com/users/etimberg/repos","events_url":"https://api.github.com/users/etimberg/events{/privacy}","received_events_url":"https://api.github.com/users/etimberg/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T01:16:05Z","updated_at":"2016-12-29T01:16:05Z","body":"@Legends did you call `destroy()` on that chart?"}}
{"actor":{"display_login":"etimberg"}}