I'm developing a touch-screen Flash application for a shoe store, and it runs fine initially, but slows down toward the end of the day. I've been diligent with removing event listeners and so on. I've now narrowed the problem to be very specific - it's one section of the application causing the problem, and one part of that section:
- I have a main movie clip which contains the animation, which itself contains 5 nested movie clips, each with their own timeline. All movie clips have a stop action on the final frame.
- images are transparent PNGs with outer glow "filter"
- the issue is not with performance as such, but with CPU increasing over time. Each time you play the clip, there is a small amount of CPU usage that 'sticks' and doesn't get freed up. What happens is that if you play the movie clip many (MANY MANY) times, then eventually it starts to slow down. Mac's Activity Monitor shows that the idle CPU usage is increasing slowly, over many times of playing the clip. It's insignificant with each play, but adds up over time.
You may be inclined to say: oh filters effect CPU, so it will be slow - but it isn't slow until it plays many, many times. Initially it's fast.
I've uploaded a .zip with .app and .exe versions of my problem section. There are two files of each type:
AutoPlay.app (& .exe): plays the problem clip repeatedly (I've just removed the final 'stop();' frame), so you can leave it open and come back in half an hour to see it slowing down.
ClickToPlay.app (& .exe): Plays the problem clip once when you click the 'play' button, so you can click several times, let it return to idle, and verify that the idle CPU usage is in fact increasing.
You can download them here: http://bbldigital.com.au/clients/sneakerology/AppsAndExes.zip
For those who are interested enough (thankyou!) I've also uploaded my .fla and the one, simple .as file: http://bbldigital.com.au/clients/sneakerology/SourceFiles.zip
Opening the 'ClickToPlay' app, and using OSX's Activity Monitor to see what's going on, initially idle CPU % is at 1.3 or so. After clicking 'play' 50 times, idle CPU % will settle down to around 7% - ie, it doesn't return back to 1.3. Another 50 times and it's at 12 - 14%. No matter how long you leave it, it doesn't return back to 1.3%.
Over a day or two's use in the shoe store, this problem cumulates to the app having chuggy animation and slow response time. Does anyone have an idea of what might be causing the gradual increase in idel CPU, over time of repeatedly playing the animation (using other sections of the app don't give the problem)? And, are there any ways around it?
Any help is very much appreciated! Thank you so much in advance.
Anyone have any insights into what could be going on here?