actionscript-3firefoxvideoadobe-scout

Whats causing a very small leak after cleanUp in my AS3? Scout File Included


I have this FlashPro/AS3 project I'm working on, and thanks to the help of @vesper and others, I've managed to make significant headway.

At the moment though, there seems to be a slight leak in memory. A very small one at best. I've set up traces such as this one in a few places.

Trace: trace("On Load" + System.totalMemory / 1024);

Locations: On Load doCleanUp launchVideo

The leak is pretty small, and according to Scout, most likely related to something in the Uncategorized memory I think.

Here is the scout file - Scout File

Heres is the Full code

It would be awesome if I could get another pair of eyes on the output.

Test results show... 1) One video being clicked and left to play out 2) Two(2) videos played and stopped/dismissed


Solution

  • After quick look at Scout Session and comparing early frames with last ones it looks like it's using a bit more memory indeed. However... in "Current Total Memory" panel you can see it's in "Other -> Network Buffers" (at the end you have like 8,966 KB in there). So my guess is netStream is not being cleaned properly. After 1st one (at about 1:12) it's only 182 KB, but after second one (1:25) it's 7,320 KB.

    Also - is there a reason why in doCleanup() function you're not calling vp.close(); ? According to DOCUMENTATION that should force stream to close.

    Also 2 - Are you sure it's all garbage collected? You can try to call System.gc(); after cleaning. It's working perfectly in AIR, not as good in flash player, but worth giving a try. You can also force garbage collector in Scout. If you go to "Memory Allocations" tab (bottom part if you're using default layout) and there should be little bin icon. See if it does make any difference.