Consider moving jemalloc into bionic for b2g

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
5 years ago
6 months ago

People

(Reporter: justin.lebar+bug, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
In B2G we continue to have problems with portions of our system using bionic's malloc/free.  This is problematic because jemalloc is a better allocator, and also because we risk allocator mismatches.

glandium explained to me that bug 850576 means that std::string may or may not use jemalloc, depending on what's inlined.  That's horrifying; it means we can introduce allocator mismatches just by changing our compiler or compiler flags.

Moving jemalloc into bionic sounds like a lot of work, but it would solve this whole class of problems on b2g.
(In reply to Justin Lebar [:jlebar] from comment #0)
> In B2G we continue to have problems with portions of our system using
> bionic's malloc/free.  This is problematic because jemalloc is a better
> allocator, and also because we risk allocator mismatches.
> 
> glandium explained to me that bug 850576 means that std::string may or may
> not use jemalloc, depending on what's inlined.  That's horrifying; it means
> we can introduce allocator mismatches just by changing our compiler or
> compiler flags.

It more depends on how std::string is implemented in stlport headers and sources, although compiler flags may have some influence.

> Moving jemalloc into bionic sounds like a lot of work, but it would solve
> this whole class of problems on b2g.

Depending how bionic is tied to its allocator, it might be straightforward.

Comment 2

4 years ago
Support for jemalloc was added to Android Lollipop and it also became the default rather than dlmalloc.

https://android.googlesource.com/platform/bionic.git/+/8e32b7b3543eadbb58a92443fb57d60aac92ef88

Comment 3

6 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.