I wan't to ask about animating Canvas by JavaScript and about Garbage Collection. I've wrote code to display rectangle:
function Test() {
var canvas = document.getElementById('mygame'),
ctx = canvas.getContext('2d');
function update() {
ctx.fillRect(20,20,150,100);
window.requestAnimationFrame(update);
}
update();
}
Test();
It's very simple. Now lets take a look at "Performance" tab in Chrome:
As you can see, the JS Heap graph is still not looking smooth. Even when there is a very simple code, GC (for some reason) is doing cleaning by using Minor GC (for example "989KB collected").
Is there possibility to avoid this? Or there will be always some GC and it's a natural thing?