{"action":"created","issue":{"url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/102","repository_url":"https://api.github.com/repos/coop182/jquery.dfp.js","labels_url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/102/comments","events_url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/102/events","html_url":"https://github.com/coop182/jquery.dfp.js/issues/102","id":88849994,"number":102,"title":"Memory Leak when refreshing ads","user":{"login":"cauedotnet","id":10039299,"avatar_url":"https://avatars.githubusercontent.com/u/10039299?v=3","gravatar_id":"","url":"https://api.github.com/users/cauedotnet","html_url":"https://github.com/cauedotnet","followers_url":"https://api.github.com/users/cauedotnet/followers","following_url":"https://api.github.com/users/cauedotnet/following{/other_user}","gists_url":"https://api.github.com/users/cauedotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/cauedotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cauedotnet/subscriptions","organizations_url":"https://api.github.com/users/cauedotnet/orgs","repos_url":"https://api.github.com/users/cauedotnet/repos","events_url":"https://api.github.com/users/cauedotnet/events{/privacy}","received_events_url":"https://api.github.com/users/cauedotnet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2015-06-16T21:55:57Z","updated_at":"2016-08-04T14:51:50Z","closed_at":"2015-06-19T17:03:53Z","body":"Jquery.dfp.js is the best implementation of dfp i founded, and really fits my project, but this problem is killing me. After i implemented $.dfp, memory consume start growing a lot. I am measuring this using chrome's 'heap snapshot'. I will explain better.\r\n\r\nI only have two ads on a page, and the code is very simple.  Im using the following method to create the ads:\r\n\r\n    var createUnit = function (holder, unit, dim, dfpid) {\r\n        $(holder).append('<div class=\"adunit\" data-adunit=\"' + unit + '\" data-dimensions=\"' + dim[0] + 'x' + dim[1] + '\"></div>');\r\n        $('.adunit:not(\".display-block\")').dfp({ dfpID: dfpid, enableSingleRequest: true }); // false don't fix my problem too.\r\n    };\r\n\r\nThis code works very well. But the problem starts when I try to refresh the ads, using the following code.\r\n\r\n\r\n    var refreshSpaAds = function () {\r\n    setTimeout(function () {\r\n        $.dfp();\r\n        refreshSpaAds();\r\n        console.log('refreshSpaAds');\r\n\r\n    }, 30000);}; refreshSpaAds(); // Normally use 60 secs...\r\n\r\n\r\nEvery time I call $.dfp(); for refreshing the ads, my memory heap increases like 15-30mb. So, in 15 minutes or less, the page overflows and brake. Chrome show a bluescreen with a dead tab image, and asks for reload all page.\r\n\r\nMy tests:\r\n- If i dont call the $.dfp(), the problem reported dont happens. Heap size don't change nothing.\r\n- If i delete and build all objects/ads, instead of calling $.dfp(), same problem happens.\r\n\r\nWhy i need to refresh?\r\n- I am using angular.js, a SPA js framework. I need to refresh the ads on page changes, and i want to refresh every 60 seconds.\r\n\r\nAnyone has passed for this problem? What should i do?\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/comments/237577408","html_url":"https://github.com/coop182/jquery.dfp.js/issues/102#issuecomment-237577408","issue_url":"https://api.github.com/repos/coop182/jquery.dfp.js/issues/102","id":237577408,"user":{"login":"jasongrishkoff","id":375379,"avatar_url":"https://avatars.githubusercontent.com/u/375379?v=3","gravatar_id":"","url":"https://api.github.com/users/jasongrishkoff","html_url":"https://github.com/jasongrishkoff","followers_url":"https://api.github.com/users/jasongrishkoff/followers","following_url":"https://api.github.com/users/jasongrishkoff/following{/other_user}","gists_url":"https://api.github.com/users/jasongrishkoff/gists{/gist_id}","starred_url":"https://api.github.com/users/jasongrishkoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasongrishkoff/subscriptions","organizations_url":"https://api.github.com/users/jasongrishkoff/orgs","repos_url":"https://api.github.com/users/jasongrishkoff/repos","events_url":"https://api.github.com/users/jasongrishkoff/events{/privacy}","received_events_url":"https://api.github.com/users/jasongrishkoff/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T14:51:50Z","updated_at":"2016-08-04T14:51:50Z","body":"I share your concern.  I'm checking with my ad guy on this.  Those trackers, beacons and other analytics are the root cause of the memory leak so uhh... yeah.  I hate ads -- wish I didn't need to use them as the revenue source on this site :("}}
{"actor":{"display_login":"jasongrishkoff"}}