SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    3 Post(s)
    0 Thread(s)

    How to prevent Chrome do garbage collection my application?

    My application has very long lifespan and I want to use static memory to keep it run smoothly.
    Since it's not a game application, I have no idea how to do the object pooling. All I can think of is keeping variables busy by refer them to something.
    How could I do that?
    The codes below gets GC every roughly 50s. I want it to live longer or no GC at all:
    var video = document.createElement('video')
      , canvas = document.getElementById('canvas')
      , ctx = canvas.getContext('2d')
    window.addEventListener('load', function() {
    	video.src = 'my_video.ogg';;
    var playVideo = function(video) { = video;
    	(function paintCanvas(video) {
    		ctx.drawImage(, 0, 0, canvas.width, canvas.height);
    Thank you,
    Last edited by ParkinT; Jul 17, 2013 at 06:55. Reason: Corrected 'CG' to 'GC'


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts