How can I figure out which tab in Safari is using CPU? I usually have several tabs open in Safari in the background, and sometimes I see it taking up an unusual amount of CPU (PluginProcess or WebProcess).

How can I figure out which tab (or tabs) is causing this? If there are no easy GUI solutions, I'm also open to Terminal-based techniques for finding the culprit. I hope not to have to do this very often.

(Note: I realize this is similar to an old question, but Safari has been updated since then and perhaps there are new techniques available.)
You need Safari 6.1 or newer
Enable Debug menu.


Update: For Mac OS Mojave and newer, go to System Preferences > Security &amp; Privacy > Privacy > Full Disk Access and add Terminal before entering the command.

    defaults write com.apple.Safari IncludeInternalDebugMenu -bool true



Set "Use Per-tab web processes" and "Show Web process IDs in page titles" to on.