In OS X Mavericks you can monitor the energy consumption of different processes in Activity Monitor. Activity Monitor showing the Energy Impact columnsHere we can see 'Energy Impact' and Avg Energy Impact' and that the values can exceed 100.

Also there will be a menu bar icon which lists the most energy consuming applications running right now.

Is there any documentation how apple calculates the current energy consumption? Is there a mapping between CPU utilization and energy consumption?

Hopefully there are some experts here who can give me a hint.

There are many aspects of CPU utilization that affect energy consumption. It's not merely how much CPU does an application consume, but also how often and how flexible it is about it. The latter can have much bigger effect.

An application that needs to wake up exactly every 10ms to execute just a few lines of simple Obj-C code can have an order of magnitude larger energy impact than the same application executing thousands of lines of code but just once a second and not being very particular about exactly when within that second will the calculation happen.

Apple probably uses Intel's performance counters and accounts them to your application. You'd probably gain most insight by following Intel manuals first to understand the power states and energy management. This will highly vary between architectures. A badly behaving app can have a much bigger impact on Haswell than on an "old" Core 2 machine.

Use of other resources, such as the audio system, doing disk I/O or using USB devices may be also factored in. A likely accounting method would assign to your application all of the energy use needed by the resources your application uses exclusively (say a custom USB device, access to an otherwise powered-down audio syste), and do some sort of pro-rating for shared hardware.

It all starts with precision monitoring and measurements down to Milliseconds.

As example Intel has made a tool to monitor the Intel CPU parameters.

It displays the Power the Frequency and the Temp.

The Power usage and the Temperature are products of the Frequency (the speed), or the amount of data processed.

The sampling rate is Milliseconds and the power is in Watts, and it measures the Total Power for the CPU while the Activity monitor breaks it down by Application/Process.

Intel

Here is a article from Apple about power management/consumption that goes in to bit more details how is power managed.

In summary, using the ms power measurement one is able to better control the overall power consumption.

Before TC

before

Using the above information on per Application and the resulting cumulative Power usage Apple has implemented the Timer Coalescing and the App Nap features to manage Power consumption resulting in the Chart below.

After TC

after

To see more information on above charts visit this article.

Since the CPU control's activity including RAM management and disk read/writes,Network Card and others for example improving RAM management also reduces power consumption that occurs by to frequent disk R/W activity.

There are many aspects of power management, and they are a combination of very accurate measurement and software designs to reduce the power consumption.

Some examples are:

App Nap feature

Timer Coalescing feature PDF

RAM management feature

  • 1
    @grgarside The images seem to come from the sites linked in the answers. Nevertheless it wouldn't harm to state the source of each picture explicitly. – nohillside Oct 29 '14 at 17:56
  • 1
    @patrix- done, showed sources for everything :) – Buscar웃 Oct 29 '14 at 18:02

There doesn't seem to be any documentation on how the power consumption is calculated. The CPU usage alone cannot reliably predict power consumption. So the primary factors considered would be (these are somewhat complementary to what App Nap looks at and controls):

  • CPU usage
  • Disk input/output
  • Network input/output
  • Peripheral use (like audio speakers, for example)

Again, there are no details on how each of these factors are measured and the formulas used to calculate the power consumption. We can make some educated guesses by the fact that every Mac (and also PC) comes equipped with various sensors within the system. You can use a tool like Hardware Monitor to see what sensors your Mac has and what they're reporting in real time.

The key sensors related to power consumption that are available (and have been for several years) in Hardware Monitor are CPU Voltage, CPU Current and CPU Power. For other elements in the above list, there are no hardware sensors to measure power consumption. So Apple must be using specific extrapolation factors depending on the model of the Mac and the underlying hardware.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.