6

I do this a lot:

  • Notice my MacBook Air is running hot
  • Open Activity Monitor, see "Google Chrome Helper" process pegged at 100% CPU
  • Open Chrome's Task Manager to find the responsible tab
  • Find and kill some blog post I opened two days ago whose JS is running an infinite loop

It's especially frustrating if it happens when I'm away from my desk, and my fans have been wearing themselves out all night for no reason.

How can I prevent this?

I know cputhrottle lets you cap the CPU usage of a particular PID, but Chrome uses many processes. I considered writing a script that periodically runs cputhrottle on each PID in ps -A | grep Chrome, but this would slow down foreground tabs as well, which I'd like to keep at full speed. Monitoring of foreground/background switches could be done through a Chrome extension, which would need to communicate to a daemon running outside Chrome via the Native Messaging API, but it seems like a lot of work both to write and to distribute. I'm hoping there's a simpler solution I'm overlooking.

2

Add the extension "The Great Suspender" to chrome. Once added, you are presented with the settings page, where you can choose when to suspend tabs, when to enable (for example, when in focus).

General settings view of Great Suspender:

enter image description here

I also check Automatically unsuspend when tab gains focus. When done with your desired settings, scroll to bottom, and click Save Settings.

I listen to music all day using Google Play, so I do not want that tab suspended, so I right-click on the tab, and choose Pin this tab.

enter image description here

Plugins themselves may be the culprit, so change when plugins run, settings -> advanced -> content settings -> plugins -> let me choose when to run plugin content

| improve this answer | |
  • updated as suggested – strobelight Sep 19 '16 at 15:22
  • I've inlined the image, but otherwise good update!. – DavidPostill Sep 19 '16 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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