Profiling Flash Applications with Flex Builder 3
If you use to create Flex Apps I’m almost sure you profile your applications with Flex Builder or with another tool related to. This time I’ll talk about profiling applications.
Profiling an application means to inspect the elements that your application is running, how much memory you application is consuming, how many instances of each class your application is executing and more information. You can compare memory snapshots of the same application but in different execution time, etc.
You can profile with Flex Builder any application generated as swf file, this includes Flex Applications, Flash Applications/Web sites/animations and any swf created with any tool that has the capability to export the project as swf file.
Before you profile an application you must ensure that the swf file has been compiled with debugging capabilities. Flex does this job for you every time you run, debug or profile your application from Flex Builder, but in Flash this doesn’t happen. You must explicitly tell Flash that your swf must be compiled for debugging. You can do this from the publish settings panel. In the flash tab you have a checkbox unselected by default which says “Permit debugging” and you must turn it on.

When you turn on this option your application will be compiled with the compiler argument “debug=true”. (You can also compile your application directly with that compile argument if you have a Flash Compiler). The compiler will embed to the swf file information needed for debugging the application, also it will try to connect the application by socket to a socket server when it starts. Flex Builder starts up that socket server when you profile or debug a swf file from Flex Builder with the green buttons in the toolbar, so, as you can imagine, you should first start up the server and then execute the swf file.
From Flex builder you have to profile an external application. You will find this option in the Menu bar – Profile – Profile External Application. This will launch a pop up window that will ask you for the swf file of the application you want to profile. You also have the option to just prepare Flex Builder for profiling and let it wait for the application to execute and connect to Flex Builder (for this you have to choose “Launch the application manually outside Flex Builder”). I will emphasize the first option which profiles directly the selected application. In this window you can browse for the swf file compiled previously in Flash or Flex with the debug option and then you just launch the profiling process and that’s all.


Don’t forget to turn off the “Permit debug” option from Flash or clear the “debug” compile argument in production mode because someone could debug you application remotely from his computer.
Enjoy it.



thanks for sharing that…
but I can’t find the option in the eclipse plugin…
any ideas where to find it?
best
joerg
Joerg, probably you don’t have installed the professional edition of the plug in.
Check it in Flex Licenses in the help menu.
Profiling is part of the professional edition.
Would you please provide a way for doing profiling for one or two swf files which are embed in the html?
Well, you can profile the swfs that are embeded in an html file if you select the option “Launch the application manually outside of Flex Builder” instead of “Launch the Selected Application” when you select “Profile an External Application”.
This will cause that Flex Builder starts the proxy server and wait for 15 seconds (or the number you type there) for the application and connect to it. During those 15 seconds you must start flash player with the application you want to profile. These application can be embed in an html or can be a swf directly in your computer or remote computer.
The requirements are that you start the swf with the debug version of flash player (if you usually work with Flash CS3 of Flex Builder you should have no problem), and the other requirement is that the swf, embedded in the html or not, must have debugging information inside as I said in the post.
Kind Regards.
I love the thorough explanation you present to us Now I have a better understanding about computer networking and truly appreciates the detailed explanation. But it is much better if we are using proxy servers because it make the connection faster. You can acquire on the internet for for this proxy info. Most especially if you wish not to reveal your basic information. Or better yet suit yourself for free proxies. As you surf, you do not need to worry because for sure your information will be kept private. I think networking is a valuable asset in any aspects of human functions right now as it provides you lots of information regarding about everything you wish to know. Thanks for the tutorial!!! proxy servers list