Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

djslim

macrumors newbie
Original poster
Mar 8, 2010
4
0
Hi all,

I'm new to Mac programming, and I had the following project in mind.

Goal: visualize how much resources an application uses

1) let user pick an app
2) visualize how much memory, hd space, cpu, it is using
3) visualize how much free space is in RAM and HD
4) visualize how much power it is using
5) visualize which cpu instruction is being executed at any moment in time
6) visualize whether it is going to the harddrive for stuff or the RAM

are all these possible? I know 2,3 is done by the activity monitor so I assume it is possible, but I wasn't sure about 4,5,6.

Is there a place I can go for some sample code?

thanks for all your help!

slim
 
4: Not really possible. You would need to do something like measure the current power draw, suspend the app, remeasure, and compare.
5: That changes 2-3 billion times per second. I don't see how you can visualize that.
6: You can use dtrace to monitor filesystem activity, but I'm not aware of a way to take into account caching.
 
Since this is a common question, particularally with embedded/mini devices, here is the easiest way without buying expensive equipment and getting a good idea:

the kill-o-watt meter is a $30 plug that sits between your normal 120v/3prong plug showing you the watts/amps/volts, available at amazon and many other outlets.

Plug-in, run, get some baseline readings and then perform the same trials running your software.

Gamers who install high-power cards/lots of mods use this and I've done the same for my carpc/embedded where a device had to be very-low power, even under high load.

For more sophisticated solutions, there are quite a bit of audrino/specialty usb devices that are the same but provide a reading via a 232/usb port and can be logged.
 
4: Not really possible. You would need to do something like measure the current power draw, suspend the app, remeasure, and compare.
5: That changes 2-3 billion times per second. I don't see how you can visualize that.
6: You can use dtrace to monitor filesystem activity, but I'm not aware of a way to take into account caching.

Awesome! Just got directed to "Instruments", which seems to be a GUI front-end for dtrace.

thanks!
 
Since this is a common question, particularally with embedded/mini devices, here is the easiest way without buying expensive equipment and getting a good idea:

the kill-o-watt meter is a $30 plug that sits between your normal 120v/3prong plug showing you the watts/amps/volts, available at amazon and many other outlets.

Plug-in, run, get some baseline readings and then perform the same trials running your software.

Gamers who install high-power cards/lots of mods use this and I've done the same for my carpc/embedded where a device had to be very-low power, even under high load.

For more sophisticated solutions, there are quite a bit of audrino/specialty usb devices that are the same but provide a reading via a 232/usb port and can be logged.

Just ordered a kill-a-watt! This should be interesting!

thanks!
 
4: Not really possible. You would need to do something like measure the current power draw, suspend the app, remeasure, and compare.
5: That changes 2-3 billion times per second. I don't see how you can visualize that.
6: You can use dtrace to monitor filesystem activity, but I'm not aware of a way to take into account caching.

Catfish_Man, do you know of any references to sample code that shows you how I can do 2? More specifically I would like to know how much memory the application is allocating and deallocating and also how much it is writing to the filesystem.

thanks in advance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.