Message Boards Message Boards

5 Replies
0 Total Likes
View groups...
Share this post:

OSX App Nap (and other power saving) support on Mathematica

Posted 10 years ago

I have a Apple MacBook Pro, on which I use Mathematica quite a bit. In order to maintain kernel state, I rarely want to close the application.

I noticed this already with Mathematica 9: Mathematica uses quite a bit of power even if it's idle, and even on a separate virtual desktop. Well, v9 was released before OSX acquired "app nap" functionality which attempts to reduce power consumption of idle, background applications.

But... this seems still to be the case with Mathematica 10. It is common to see Mathematica on top of energy hogs list in Activity Monitor Energy view, with constant "Energy Impact" of 14 or so. Even when it's in background, and doing perfectly nothing. Supposedly it's idle-polling something, but it really shouldn't. Safari with maybe 100 open tabs may easily have lower energy impact. Most other idle applications show low single digits impact at most.

Is there a fix for this, or is an improvement on this regard in the plans?

POSTED BY: Jari Kirma
5 Replies
Posted 9 years ago

I see the same type of behavior on my MacBook Air (13-inch, Mid 2013)

Specs: Proc : 1.4 GHz Intel Core i5, Memory : 8 GB 1600 MHz DDR3 Graphics : Intel HD Graphics 5000 1536 MB

Even when just left open with one window and nothing entered into it I see between 1.3-1.6% energy impact on each of the WolframKernel processes constantly. These processes also show a CPU usage of ~0.7% each that never goes away.

On desktops this is fine, but on something like a macbook air this has a significant impact on battery life.

I even took screenshots :)

Thank you for time and consideration of this matter, Jon

Image of Mathematica with Energy usage tab open

Image of Mathematica with CPU usage tab open

POSTED BY: Jon Ringuette

Mathematica does not use the CPU if you are not running any calculations, and does not waste energy.

However, if your MacBook Pro has switchable graphics (if you have an NVIDIA graphics card), then it does trigger switching to the NVIDIA card, which drains a significant amount of power.

To have better control over this, install the gfxCardStatus utility which always shows which graphics card is in use. You can use it to force using the more energy-efficient integrated graphics. Doing this will prevent CUDALink from working, will reduce the functionality of OpenCLLink, and will somewhat reduce the performance of rendering 3D graphics. Unless you use CUDALink/OpenCLLink, this won't impact your use of Mathematica much. I always force using the integrated graphics when using Mathematica on battery.

POSTED BY: Szabolcs Horvát
Posted 10 years ago

I know all this, and still Energy tab shows considerable use even when I have nothing but a kernel and FE idling, even without content on the notebooks. I believe FE and kernel(s) perform some sort of copious polling, which keeps CPUs away from deeper sleep states. This consumes almost zero CPU time, but not so for the energy. At least Activity Monitor thinks so, and I believe it's quite correct. Also, highly scientific "how warm frame just on front of display is" methodology points towards this direction. It tends to be constantly warm when Mathematica is idling on the background.

POSTED BY: Jari Kirma

So you have disabled the discrete graphics card in your machine, and battery life is still bad?

POSTED BY: Szabolcs Horvát
Posted 10 years ago

I have disabled discrete graphics. I haven't made any specific experiments on measuring battery lifetime, but usually Energy view correlates well with real energy use.

POSTED BY: Jari Kirma
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract