Closed Bug 1082199 Opened 5 years ago Closed 5 years ago

jemalloc3 builds exhibit negative heap-unclassified values in about:memory

Categories

(Core :: Memory Allocator, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: ggp, Assigned: ggp)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(1 file, 1 obsolete file)

An AWSY run last week [1] showed that builds using jemalloc3 are under-reporting heap-allocated in about:memory, causing heap-unclassified to be negative; see build 99fd55feb996 [2], for example, in that run. The issue also reproduces locally on Mac.

1- https://areweslimyet.com/?series=sm-partitions
2- https://tbpl.mozilla.org/?tree=Try&rev=99fd55feb996
Whiteboard: [MemShrink]
Calling je_mallctl to update jemalloc3's epoch in jemalloc_stats forces the
allocator's stats to be updated. This patch seems to fix heap-allocated both locally
and on AWSY (see build 5810e3365b9d [1] in [2]).

1- https://tbpl.mozilla.org/?tree=Try&rev=5810e3365b9d
2- https://areweslimyet.com/?series=sm-partitions3
Attachment #8504334 - Flags: review?(mh+mozilla)
Better graph for [2] in the above comment: https://areweslimyet.com/?series=sm-partitions3#evenspacing
Whiteboard: [MemShrink] → [MemShrink:P2]
Comment on attachment 8504334 [details] [diff] [review]
Recompute stats in jemalloc_stats when using jemalloc3.

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

::: memory/build/mozjemalloc_compat.c
@@ +69,5 @@
>    size_t lg_chunk;
>  
> +  uint64_t epoch = 0;
> +  size_t esz = sizeof(epoch);
> +  int ret = je_(mallctl)("epoch", &epoch, &esz, &epoch, esz);

Please add a comment that this triggers a refresh of some stats in jemalloc, cf. ctl_refresh in src/ctl.c.
Attachment #8504334 - Flags: review?(mh+mozilla) → review+
Assignee: nobody → ggoncalves
Thanks, comment added, carrying over r+.

Try: https://tbpl.mozilla.org/?tree=Try&rev=c382b405ba14
Attachment #8504334 - Attachment is obsolete: true
Attachment #8507234 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/169ea979fe84
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.