views:

55

answers:

2

When I run my swf locally in the Flash Player application, its memory usage starts at around 50 Mb, and though it definitely fluctuates, it generally stays centered at around 50 Mb.

Then I embed the same swf in an html page and run it in my browser (firefox). Now the memory usage starts at 20 Mb, but increases at a near constant rate until it is over 100 Mb and I need to stop it. The swf is essentially unusable in the browser because of this.

What could be the cause of this huge difference in behavior? Where should I even begin when trying to make the swf functional in the browser?

EDIT: I have found what was causing the problem (sort of). A certain type of object, which gets spawned a lot during the game, doesn't respond to removeChild() correctly. As a result these types of objects were building up on the stage (but invisible) and causing the memory usage to skyrocket. This doesn't occur when I test it in CS4 or in the standalone flash player application, only in the browser. It seems like a Flash bug.

Thank you to everyone who responded, you have indirectly caused me to find the weird problem!

A: 

Probably player using memory cache. In chrome web browser you can go to the task manager and if your browser using flash player, you can see memory usage of flash plugin used by chrome. In my opinion it's all obout player configuration.

UGEEN
Hm... what should I be looking for in the task manager of Chrome? Right now I just see the memory of the Flash Player plugin increasing in parallel with the memory usage the swf itself is reporting.
kbaum
look at the nert statistics - you can see the private/shared/total even virtual memory statistic - what you can read from those data depends of you and typical flash application.
UGEEN
+1  A: 

I have found what was causing the problem (sort of). A certain type of object, which gets spawned a lot during the game, doesn't respond to removeChild() correctly. As a result these types of objects were building up on the stage (but invisible) and causing the memory usage to skyrocket. This doesn't occur when I test it in CS4 or in the standalone flash player application, only in the browser. It seems like a Flash bug.

Thank you to everyone who responded, you have indirectly caused me to find the weird problem!

kbaum
An object doesn't respond to removeChild() if it has strong reference which are not set to null. and CS4 uses Flash player 10 and your browser may be using Flash player 9.
Muhammad Irfan