Closed Bug 1628033 Opened 4 years ago Closed 4 years ago

About:Memory does not list a PID for Main Process and Socket Process

Categories

(Toolkit :: about:memory, defect, P3)

77 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: lh.bennett, Assigned: n.nethercote)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

Main Process has not had a PID listed for a while but Socket Process is fairly new. Its much easier to track down the processes when there's a PID attached.

Component: General → about:memory
Product: Core → Toolkit

The priority flag is not set for this bug.
:njn, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(n.nethercote)

This is modelled on the corresponding code in
RDDParent::RecvRequestMemoryReport().

Assignee: nobody → n.nethercote

Adding the PID to the socket process is easy and I have uploaded a patch for it.

The main process is harder, because it gets special treatment -- normal memory reporters use an empty string for the process name and then about:memory turns that into "Main Process". Is it possible to get the main process pid from JS chrome code?

Flags: needinfo?(n.nethercote)
Priority: -- → P3

Is it possible to get the main process pid from JS chrome code?

Services.appinfo.processID does the trick!

Services.appinfo.processID does the trick!

Hmm, no, that won't work. E.g. if we load memory reports from file, we need the PID from when they were saved, not the current PID, because they may have been saved in a different invocation of Firefox (possibly even on a different machine).

Attachment #9144219 - Attachment description: Bug 1628033 - Add pid to the SocketProcess in about:memory. r=valentin → Bug 1628033 - Add pid to the socket process in about:memory. r=valentin

Oh, interesting: if you get live measurements by pressing the "Measure..." button, you just get "Main Process" for the main process. But if you do "Measure and save..." and then subsequently load, you get "Main Process (pid XYZ)", due to this code.

In the tests we now explicitly use "Main Process" (or similar) for the process
name in various places to avoid having to filter out a PID.

Also in test_aboutmemory[34].xhtml, the main process entries now appear
first, as they should, because the sorting code now looks for a "Main Process"
prefix, rather than an exact match.

Depends on D72995

Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5112f6a72171
Add pid to the socket process in about:memory. r=valentin,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/693d927ca216
Add pid to the main process in about:memory. r=erahm
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: