Closed
Bug 431221
Opened 17 years ago
Closed 17 years ago
Disable glib slice allocator
Categories
(Core :: Memory Allocator, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jasone, Assigned: jasone)
References
Details
(Keywords: mobile)
Attachments
(2 files, 1 obsolete file)
47.06 KB,
application/pdf
|
Details | |
1.04 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
glib provides a slice API[1], which is implemented as a zone allocator layered
on top of malloc. Since jemalloc is itself a zone allocator, the extra
abstraction level forces segregation of equal-sized objects that could
otherwise be packed together.
I ran the talos benchmark and plotted the memory usage for tp (see attachment). Mapped memory (tp_Private Bytes) is markedly lower if the slice allocator is disabled. Resident set size (tp_RSS) also appears to be slightly lower, on the order of 1-2%. A longer run may show more significant fragmentation reduction.
[1] http://library.gnome.org/devel/glib/stable/glib-Memory-Slices.html
Assignee | ||
Comment 1•17 years ago
|
||
Attachment #318233 -
Flags: review?(doug.turner)
Comment 2•17 years ago
|
||
Comment on attachment 318233 [details] [diff] [review]
Disable glib slice allocator
this looks like the right thing, but bsmedberg is the guy to review it.
does /dev/null always exist on every unix platform we care about?
Do all application on linux using jemalloc use run-mozilla.sh (xulrunner, ff, tb?) I am wondering if we can do this inside of the app programmatically? (probably too late?)
Attachment #318233 -
Flags: review?(doug.turner) → review?(benjamin)
Comment 3•17 years ago
|
||
Instead of using >/dev/null, simply close the fd with >-
Comment 4•17 years ago
|
||
Could we use 'sh' builtin commands to avoid starting a new process?
For example:
: ${G_SLICE:=always-malloc}
Comment 5•17 years ago
|
||
Just match existing usage in run-mozilla.sh with
if [ -z "$G_SLICE" ]
then
G_SLICE=always-malloc
export G_SLICE
fi
Comment 6•17 years ago
|
||
Comment on attachment 318233 [details] [diff] [review]
Disable glib slice allocator
yeah, use test -z "$G_SLICE"
But, is there really no way to do this programmatically from main()?
Attachment #318233 -
Flags: review?(benjamin) → review-
Assignee | ||
Comment 7•17 years ago
|
||
Re: [ -z "$G_SLICE" ], I specifically avoided that construct because it overrides an empty, but existing, G_SLICE environment variable. My intention was to be minimally disruptive.
That said, the attached patch unconditionally disables the slice allocator programmatically.
Attachment #318233 -
Attachment is obsolete: true
Attachment #318448 -
Flags: review?(benjamin)
Updated•17 years ago
|
Attachment #318448 -
Flags: review?(benjamin) → review+
i know that some people like trying to make /dev/zero readonly and it seems some people also like to make /dev/null readonly. not sure if you care. I do know that we've had talkback crash reports (i.e. user complains talkback is broken) for one of those two cases (I can't remember which).
Assignee | ||
Updated•17 years ago
|
Assignee: jasone → nobody
Status: ASSIGNED → NEW
Component: Startup and Profile System → jemalloc
Product: Firefox → Core
QA Contact: startup → jemalloc
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → jasone
Status: ASSIGNED → NEW
Assignee | ||
Comment 9•17 years ago
|
||
changeset: 15459:621becf19fe6
user: Jason Evans <jasone@canonware.com>
date: Fri Jun 20 10:34:42 2008 -0700
summary: Bug 431221: Disable glib slice allocator, r=benjamin
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 10•17 years ago
|
||
(In reply to comment #8)
> i know that some people like trying to make /dev/zero readonly and it seems
> some people also like to make /dev/null readonly.
offtopic, but doing either is completely deranged and not worth supporting; more so for the latter; i'm amazed the system even boots with a read-only null device.
You need to log in
before you can comment on or make changes to this bug.
Description
•