Closed Bug 1713271 Opened 3 years ago Closed 3 years ago

logalloc-replay doesn't calculate RSS properly

Categories

(Core :: Memory Allocator, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

Details

Attachments

(2 files, 1 obsolete file)

We calculate RSS by parsing /proc/smaps. So that we can calculate the RSS of the malloc implementation only we do an initial pass of /proc/smaps as the program starts which we can use to exclude unrelated maps such as data segments belonging to shared libraries. However the system libc calls malloc (on both shared and static linking paths) causing jemalloc to allocate a chunk of memory before we have a chance to make our initial pass of /proc/smaps.

isspace requires data in libc to be initialised. If we're parsing
/proc/smaps before libc has initialised we need to provide our own
implementation.

Depends on D116337

Use a weak linkage function pointer to gain control before
malloc_init_hard() runs. Use this to capture the initial memory maps.

This can occur before dynamic C++ initialisation so we have to be careful
what data we access.

Depends on D116338

Attachment #9224224 - Attachment description: Bug 1713271 - Capture the initial maps as jemalloc starts r=glandium → Bug 1713271 - Capture the initial maps during static initialisation r=glandium
Attachment #9224222 - Attachment is obsolete: true
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1b63f9b29728 Provide our own isspace implementation r=glandium https://hg.mozilla.org/integration/autoland/rev/1cfda2726fab Capture the initial maps during static initialisation r=glandium
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: