Remove the "heap-used/js/string-data" memory reporter because it is totally bogus

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
JSRuntime::stringMemoryUsed purports to record how much heap memory is used by string chars.  But strings have undergone many upheavals recently and I don't trust it.  It needs to be audited.

(Actually, it would be better to find all these chars from the actual string headers, which involves scanning the GC heap to find all the strings.  Bug 625305 has some code along those lines.  But there might be some quick fixes in the meantime.)
(Assignee)

Comment 1

6 years ago
The about:compartments style of measuring this (trace through the GC heap) seems better -- it doesn't rely on remembering to add/subtract some global counter in a dozen different places.
(Assignee)

Comment 2

6 years ago
I have concrete confirmation of my distrust!  Bug 633653 comment 83 shows this
report after running Kraken:

> Used Heap Memory
> 121,174,804 B (100.0%) -- heap-used
> ├──4,277,801,142 B (3530.27%) -- js
> │  ├──4,234,772,742 B (3494.76%) -- string-data
> │  ├─────34,603,008 B (28.56%) -- gc-heap
> │  ├──────7,336,784 B (06.05%) -- tjit-data
> │  │      └──7,336,784 B (06.05%) -- allocators
> │  │         ├──5,550,000 B (04.58%) -- reserve
> │  │         └──1,786,784 B (01.47%) -- main
> │  └──────1,088,608 B (00.90%) -- mjit-data
> 
> with most of the string-data given back below:
> 
> ├────3,137,357 B (02.59%) -- layout
> │    ├──3,137,357 B (02.59%) -- all
> │    └──────────0 B (00.00%) -- bidi
> └──-4,192,137,179 B (-3459.58%) -- other

I am going to simply nuke this reporter.  It can be put back in later with an
about:compartments-style heap traversal.
(Assignee)

Updated

6 years ago
Summary: I don't trust stringMemoryUsed → Remove the "heap-used/js/string-data" memory reporter because it is totally bogus
(Assignee)

Comment 3

6 years ago
Created attachment 530238 [details] [diff] [review]
patch (against m-c 68986:e364ff60c2cb)
Assignee: general → nnethercote
Attachment #530238 - Flags: review?(gal)

Updated

6 years ago
Attachment #530238 - Flags: review?(gal) → review+
(Assignee)

Comment 4

6 years ago
http://hg.mozilla.org/mozilla-central/rev/62073f1776e3
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.