How to identify application of hung menu bar icon

Solution 1:

Use the Accessibility Inspector, accessible from Xcode → Open Developer Tool → Accessibility Inspector.

Click "Show" on the "Hierarchy" sub-section (which will show you the Application Name).

Click on the "Target Icon" at the top of the Inspector (Labeled: Start inspection follows point).

Hover over the item and the pane may show you enough information for you to determine what it is. For example, hovering the Dropbox menu bar item shows "Dropbox <version>" under AXHelp, and hovering Little Snitch shows "Little Snitch Agent" under AXTitle.

Solution 2:

You can look in Activity Monitor's list of processes for any which are not responding. Such processes are shown in red, as below, and can be force quit or killed.