Closed Bug 1134123 Opened 9 years ago Closed 9 years ago

[jemalloc3] Disable (infinite) chunk recycling

Categories

(Core :: Memory Allocator, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

      No description provided.
Jemalloc 3 has, by default, a form of chunk recycling enabled, where it
actually doesn't unmap any chunk it ever allocated. Considering Gecko has
other uses of mmap, it can lead to premature address space exhaustion.

Until we have actual (limited) chunk recycling in jemalloc3 from bug
1107677, just disable this feature.
Attachment #8565865 - Flags: review?(n.nethercote)
Comment on attachment 8565865 [details] [diff] [review]
Disable (infinite) chunk recycling in jemalloc3

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

Seems fine...

::: configure.in
@@ +9101,5 @@
>    # Force disable DSS support in jemalloc.
>    ac_configure_args="$ac_configure_args ac_cv_func_sbrk=false"
>  
> +  # Make Linux builds munmap freed chunks instead of recycling them.
> +  ac_configure_args="$ac_configure_args --enable-munmap"

... but why is it Linux-only? Isn't this code affecting all platforms?
Attachment #8565865 - Flags: review?(n.nethercote) → review+
--enable-munmap is the default on other platforms, I believe. It's interesting that all platforms have their idiosyncrasies - on Windows, VirtualAlloc/VirtualFree calls must be matched, on Linux munmap can end up fragmenting the address space, and on OSX munmap calls are slow.
https://hg.mozilla.org/mozilla-central/rev/3bc7f92f4934
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.