开发者

Is it possible to profile CPU / memory inside an Adobe AIR application?

开发者 https://www.devze.com 2022-12-25 13:46 出处:网络
Couldn`t find any ActionScript native APIs even in the beta documentation, am I right supposing that this means the only way to measure CPU / 开发者_StackOverflowmemory consumption is by cooking up a

Couldn`t find any ActionScript native APIs even in the beta documentation, am I right supposing that this means the only way to measure CPU / 开发者_StackOverflowmemory consumption is by cooking up a custom native solution, hooking it up with AIR and making it work on each targeted platform?

Basically the aim is to be able to have this information available inside AIR and not having to use an external application for profiling, not even Flex / Flash builder.


Thanks for the helpful answers, System.totalMemory sneakily eluded me!

Seems for the CPU load the only solution will be some command line scraping using NativeProcess.


you can measure the memory consumption like this:

System.totalMemory

if you google for "as3 fps" you will find a lot of sites discussing how to measure the actual framerate.

but i don't think you can find out the cpu consumption of your flash app without outside help.


You might want to give this AIR based debugger a try, it's really pretty good:

http://www.monsterdebugger.com/


Actually you can access the same API used by the Flex Builder profiler, if you don't want to pay for Flex Builder. It's not documented very well, so it would probably take a lot of work, but it's here for those that are interested:

flash.sampler package detail


Alcon is another debugger which offers real-time memory profiling.


I found an undocumented API flash.system.System.processCPUUsage():Number but when I use it it returns 0. I'm wondering if it's a release build only API?

It takes me a while to create a release build because I have debug versions installed in all the browsers. Yep, I don't know how to quickly test release builds in a release player. I'll try to report back when I have a release to test it in.

How to get CPU usage in flash?

0

精彩评论

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

关注公众号