Add page fault counts to GC statistics

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

unspecified
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

5 years ago
Created attachment 614625 [details] [diff] [review]
patch

This counts how many page faults happened during a GC and puts it in the JSON data. It counts both hard and soft faults, since Windows is apparently unable to separate them. Hopefully that will still be valuable though.

I also changed the formatting of text and JSON a little. For the text output, it changes this:
  Slice: 3, Time: 1300ms (Pause: 18ms, Reason: ...)
to this:
  Slice: 3, Pause: 18ms (When: 1300ms, Reason: ...)
This moves the number people care about to the front and is less confusing.

I also noticed that beginArray and beginObject use putQuoted and I think they should use putKey. The consequence of this is that the slices array in JSON was called "Slices" rather than "slices". This patch fixes the problem.
Attachment #614625 - Flags: review?(terrence)
Comment on attachment 614625 [details] [diff] [review]
patch

Review of attachment 614625 [details] [diff] [review]:
-----------------------------------------------------------------

I love it.
Attachment #614625 - Flags: review?(terrence) → review+
(Assignee)

Comment 2

5 years ago
Created attachment 621648 [details] [diff] [review]
patch to make windows builds work

Apparently we need this psapi.lib thing in order to use GetProcessMemoryInfo, which tells us the number of page faults.
Attachment #621648 - Flags: review?(dmandelin)
Attachment #621648 - Flags: review?(dmandelin) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/77a87e7c6f50
Target Milestone: --- → mozilla15

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/77a87e7c6f50
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
FWIW, we have code for this on *nix in xpcom/base/nsMemoryReporterManager.cpp.  We can separate hard and soft faults there, which is nice.
(Assignee)

Comment 6

5 years ago
(In reply to Justin Lebar [:jlebar] from comment #5)
> FWIW, we have code for this on *nix in
> xpcom/base/nsMemoryReporterManager.cpp.  We can separate hard and soft
> faults there, which is nice.

I couldn't figure out how to do this on Windows, so I just decided to combine them. Maybe later if it makes sense we can split them out on Mac and Linux.
> I couldn't figure out how to do this on Windows, so I just decided to combine them.

Yes, I don't think it's possible to split them out on Windows.  And I don't know how useful soft page faults are for detecting memory pressure.
(Assignee)

Comment 8

5 years ago
This bug isn't about detecting memory pressure. It's for bug triage. If someone has really long GC times, I want to be able to see if it's because they're paging a lot.

Updated

5 years ago
Depends on: 759459
You need to log in before you can comment on or make changes to this bug.