Closed Bug 648490 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: njn, Assigned: njn)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.)
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.
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.
Summary: I don't trust stringMemoryUsed → Remove the "heap-used/js/string-data" memory reporter because it is totally bogus
Assignee: general → nnethercote
Attachment #530238 - Flags: review?(gal)
Attachment #530238 - Flags: review?(gal) → review+
http://hg.mozilla.org/mozilla-central/rev/62073f1776e3
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.