开发者

What are these unexplained script stall exceptions?

开发者 https://www.devze.com 2023-03-19 06:58 出处:网络
Our flash game is run by almost 4000 users/day, and about 2% of the users get a script stall (Flash exception on error #1502 and #1503). We know these errors are happening because we trap and log thes

Our flash game is run by almost 4000 users/day, and about 2% of the users get a script stall (Flash exception on error #1502 and #1503). We know these errors are happening because we trap and log these exceptions using the Flash Player 10 uncaughtErrorEvents feature.

We're also logging a function call history, so we can see that the exception always seems to happen in a different place in the ActionScript3 code, but of course is usually in the parts of the code that runs the most often.

I'm 99% sure our code is not stuck in an infinite loop, which I know is what this error is originally made for.

What I suspect is happening is that the user is running on a very slow machine, and flash is doing garbage collection or something, which is causing a stall. Flas开发者_如何学Ch is then detecting a long execution of code and aborting that because it's exceeding the script time limit set in the Flash Publish Settings. We've currently got this set to 20 seconds, which should be more than enough time for any of our code to run on a decent machine.

Has anyone else experienced a similar problem? What solutions were used, short of setting the script time limit to some huge number, which we might just have to do?


It sounds like a page-file hang OR Slow computers that randomly crash for kicks.

Your flash is contained inside the browser. Which is stored in memory. Now when a user needs more memory then they have -on lets say windows- data for memory is stored on part of the hard drive as 'virtual memory' inside a 'page file', allowing them to run as many applications as they want at once.

This is all well and good, but it means if the thread your Flash is working in, has for whatever reason been moved in part, or in whole to virtual memory, then every update must poll the hard drive for memory access.

Hard drives are slow, dead slow when compared to actual RAM (random access memory), and because they are so slow priority comes first, always. So because it can't update until it can read from the hard drive, it hangs. Since flash knows that if an update isn't called for a certain period of time (usually when a script is stuck in a loop), it throws the error you are receiving.

The biggest mistake I see that causes this kind of thing, is when there is a memory leak. Usually in the form of 'thought it was deleted, and garbage collected objects'. Try profiling the memory in a debug run and play for a few hours, check to see if the memory load is increasing as you do the same thing over and over. Keep an eye on array sizes, look for things like movie clips that are removed from the screen but never deleted (and thus held in memory). Poorly written menus frequently suffer from this dilemma.

There is also always a chance that a bogged down computer simply can't keep up with per-frame processing, while say something like an antivirus starts a system scan (hogging memory), which would more realistically accommodate for your sporadic data.

0

精彩评论

暂无评论...
验证码 换一张
取 消