Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when exporting html5 canvas from Flash CC 2015 #1

Open
dvhoafrontflip opened this issue Nov 18, 2015 · 1 comment
Open

Comments

@dvhoafrontflip
Copy link

Hi guys,

I'm using Flash CC 2015 publish a Html5 banner, open it on chrome for 30 minutes and the huge memory waste on my PC. I had tried to reproduce this problem on both chrome, firefox latest version and the same things.

Memory leak in 2 context:

  1. As you can see in Chrome task manager, memory still increase while the tab is in focus.
    memory leak
  2. Switching to another tab, the banner's still eating more memory.
    I tried to add more 25 banners by loading into 25 iframes in a single page and final result memory was increased so fast.

To Fix it:
An workaround for context 2 by edit the publishing html file and adding some small function to listen "visibilitychange" event when user switch tab and stop the ticker when tab lost focus:

var isActive = true;

function onStopAnimation() {
    createjs.Ticker.removeEventListener("tick", stage);
}

function onStartAnimation() {       
    if(isActive == true) {              
        createjs.Ticker.addEventListener("tick", stage);
    }else {
        onStopAnimation();
    }
}

function handleVisibilityChange() {
    if (document.hidden) {     
        isActive = false;
        onStopAnimation();
    } else {            
        isActive = true;
        onStartAnimation();
    }
}

document.addEventListener("visibilitychange", handleVisibilityChange, false);   

For context 1, it looks like the ticker still running and redawn the object?
any tips for how to work around when we public html with flash cc 2015

Thanks,
Hoa

@dvhoafrontflip dvhoafrontflip changed the title Memory leak when exporting html5 canvas from flash cc 2015 Memory leak when exporting html5 canvas from Flash CC 2015 Nov 18, 2015
@sveg-pl
Copy link

sveg-pl commented Oct 6, 2016

Hi @dvhoafrontflip
I know it's been almost a year yet the Flash CC 2015 has changed to the Animate CC and I wanted to test your issue. I've run html5ads recently and the leak is NOT present.

I've published the "garyad" using Animate CC 2015.2 with one instance of the ad and also with 5 instances using iframes, just like you did. The memory footprint rises slowly and after some time it stays or drops a bit. With one instance of the ad, the memory footprint starts at ~22 MB and grows to ~50 MB (even without the tab being in focus), so it indeed looks like a leak, but then the memory stays around this value.

What is more important – I even used old "garyad" files straight from the html5ads ZIP (without any compilation or publishing), coming from the Flash CC as I presume. Probably the same that you've used, as they were not changed since October '15 and I also did not observe the leak resembling that one of yours. This could mean that the bug was in fact caused by some kind of JS interpreting error...

Best regards,
SVEG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants