Apple - Has anyone figured out how to identify the unique page of each separate Safari Web Content process with Safari 7/Mavericks?

This is not an ideal solution but a quite good working workaround.

Open Safari then go to Preferences. Activate the Debug option (Show develop menu in menu bar)

Safari Preference Pane EDIT: Instead of activating the develop menu, you have to open a terminal and activate the debug menu with defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

Thanks @Collin C.

You will find the option Show Web Process IDs in Page Titles under Debug > Miscellaneous Flags

Show Web Process IDs

If you open the Activity Monitor now, you can see the Web Process IDs to the corresponding websites.

Web Process ID and Activity Monitor

I hope this is helping you.


If you hover you mouse over the name of the Process a Tooltip will show up telling you the URL Base domain

enter image description here


Update: “Which URLs are associated with each Safari PID?”

This is an update on the topic of seeing which Safari URLs are associated with which PIDs in Activity Monitor. I am using Safari 8.0.6 on Yosemite 10.10.3 with Debug menu on, and with the “Show PIDs in the page titles” option on. (See above and below for how to do this.)

Nicolas B stated that “we still miss the opposite way: Process > Tabs”, referring to looking for a list of tab names based on the single line-item PID in Activity Monitor.

I can show you how to see all of the tabs associated with a particular web process (PID), although it may not completely bring satisfaction, since:

  • it is a multi-step process, and
  • trying to find the logic in PID assignments based on tabs is akin to reading tea leaves it seems.

It should also be remembered that listing all page URLs associated with any single web process within Activity Monitor is not practicable in the UI as it exists today. (I wish Apple’s Safari team would add it into the info window for web processes, however!)

At first, I assumed the name shown on the process line-item referred to the last full page opened by that PID (not including cached pages), but alas this does not appear to be the case. I am not sure how the line-item actually gets its name. I will share the results of my experiment to find the answer following my explanation of how to see what tabs are associated with each line-item in Activity Monitor.

Step-by-Step

  1. Turn on the Debug menu in Safari

  2. Enable the option to Show Web Process IDs in Page Titles (as explained above)

  3. Get this excellent Safari extension from Brett Terpstra, TabLinks.
    (Please donate to him if you find the plugin useful!)

  4. Run the extension by pressing button with the small link icon (Usually left of Safari’s search/location bar)

  5. In the extension, add a separator character into the template used to display the results (for future search-and-replace work).

    I inserted a ying-yang character, so my template was: [%w-%n]:☯%u☯%t. This will give you the results—including the [WP PID] information at the end of each tab name—from Safari’s debugging info.

  6. Copy and paste the results into your favorite text editor app. (Nisus Writer Pro is mine!)

    Do a search-and-replace on your separator character (for me, ☯), and replace them with a tab character (here’s one: ).

    Do another search-and-replace on [WP, and replace only the single leading space with a tab character «tab»[WP. This will allow you to split the PIDs into a separate column in a spreadsheet.

    Save this file as a .tab plain text file.

  7. Open the tab file in a spreadsheet app (I used Numbers) and have fun sorting by PID. Now there's only one more step...

  8. In Activity Monitor, select View ▶︎ All Processes, Hierarchically, and copy-paste the list of line-items showing URLs into your spreadsheet, alongside the tab names and numbers you already have there.

    (You can discard all of the column data you don’t need and just keep the URLs and PIDs in two columns; or, add the Memory column to compare RAM usage, too.)

That’s it; not exactly quick, but not terribly complicated. There’s probably a faster way, but this was my first try to get this info.

After doing this, you may find results similar to mine. I had 9 windows open with a total of 36 tabs, all being contained in 20 “url-style” processes.

(NOTE: Here, I am not including the many QTKitServer and Safari Web Content processes. These run alongside most—if not all—of the “url processes”. These QTKitServer processes have a tiny RAM footprint in comparison to the main “url processes”, e.g., 4.5 MB vs 300 MB.)

Observations

  • I had 9 windows with 36 tabs, running in 20 processes

  • RAM use was total of 5.4 GB (average 258 MB per process)

  • Private memory was 2.0 GB total (average 97 MB per process)

  • Any single process line-item may contain one or more tabs (mine usually had one or two tabs per PID)

  • The URL name in the line-item does not seem to follow any pattern I can discern, except that the name usually (but NOT ALWAYS) reflects the base URL of one of the tabs assigned to that PID

  • Sometimes the URL name is inaccurate! Of my 20 processes, 4 used a URL which was NOT open in any of my tabs.

    (Could these be cached pages, perhaps?)

  • A new tab (or window) may be assigned either to an existing PID, or to a new process, seemingly in a “random” fashion. They are neither sequential, nor grouped with any particular window; thus, any window with multiple tabs can have several PIDs running alongside each other.

This is enough for now! I hope someone a lot smarter than I can come along and explain a little more! Aloha.

Tags:

Macos

Safari