{"issue":{"title":"Memory leak with Canvas and streaming video","user":{"login":"ronsykes","id":1084049,"url":"https://api.github.com/users/ronsykes","gravatar_id":"72e4a267e9324a9de9920ffec6590c3c","avatar_url":"https://secure.gravatar.com/avatar/72e4a267e9324a9de9920ffec6590c3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-16T21:51:04Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-26T09:00:15Z","id":2584811,"closed_at":null,"html_url":"https://github.com/mrdoob/three.js/issues/922","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Using Chrome 16.\r\n\r\nFirst, I create a texture object from a canvas that is loaded from a MJPEG stream and store it into a custom object within a function that I call every 1/3 of a second. I am constantly refreshing my canvas with a streaming video.\r\n\r\n```javascript\r\nvar ctx = canvas.getContext('2d');\r\nctx.drawImage(img, 0, 0);\r\nvar texture =  new THREE.Texture(canvas);\r\nstreamObject.texture = texture;\r\n```\r\n\r\nThen, I execute another function to display that texture by retrieving it from the custom object and setting the material's map to that texture before I call my render function.\r\n\r\n```javascript\r\nvCam.material.map = textureTemp;\r\nrender(vCam);\r\n```\r\n\r\nThe problem however is that my memory climbs through the roof If I do not force a garbage collection with:\r\n   \r\n```javascript\r\n                try {\r\n\t\t\twindow.gc();\r\n\t\t\t\t} catch(e) {\r\n\t\t\t\t\tconsole.log(\"Garbage Collection is not available for this browser type.\");\r\n\t\t\t\t}\r\n```\r\n\r\nI would like to avoid forcing the garbage collection.\r\nIs it possible that the texture objects are not being gc'd creating my memory to climb?","number":922,"url":"https://api.github.com/repos/mrdoob/three.js/issues/922","comments":1,"assignee":null},"comment":{"user":{"login":"mrdoob","id":97088,"url":"https://api.github.com/users/mrdoob","gravatar_id":"a00211a1e1aa4fe920302e7b76da0d91","avatar_url":"https://secure.gravatar.com/avatar/a00211a1e1aa4fe920302e7b76da0d91?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-26T09:00:15Z","updated_at":"2011-12-26T09:00:15Z","id":3273467,"body":"Have you tried using `new THREE.Texture(video)` instead?","url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/3273467"},"action":"created"}