aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix miscalculating large memory allocations.android-mainline-10.0.0_r9android-mainline-10.0.0_r7android-mainline-10.0.0_r5android-mainline-10.0.0_r4android-mainline-10.0.0_r10android-10.0.0_r9android-10.0.0_r8android-10.0.0_r7android-10.0.0_r45android-10.0.0_r44android-10.0.0_r43android-10.0.0_r42android-10.0.0_r41android-10.0.0_r40android-10.0.0_r39android-10.0.0_r38android-10.0.0_r37android-10.0.0_r36android-10.0.0_r35android-10.0.0_r34android-10.0.0_r33android-10.0.0_r32android-10.0.0_r31android-10.0.0_r30android-10.0.0_r14android-10.0.0_r13android-10.0.0_r12android10-qpr3-s1-releaseandroid10-qpr3-releaseandroid10-qpr2-s4-releaseandroid10-qpr2-s3-releaseandroid10-qpr2-s2-releaseandroid10-qpr2-s1-releaseandroid10-qpr2-releaseandroid10-qpr1-mainline-releaseandroid10-mainline-media-releaseandroid10-devandroid10-d4-s1-releaseandroid10-d4-releaseandroid10-c2f2-s2-releaseandroid10-c2f2-s1-releaseandroid10-c2f2-releaseChristopher Ferris2019-05-021-34/+39
| | | | | | | Bug: 131864803 Test: New bionic unit test to make sure that mallinfo and malloc_info match. Change-Id: Id2fd0c38106fa0150ff6baae538ecaea356296ec
* Remove unused stats from cache structure.Christopher Ferris2019-05-012-0/+20
| | | | | | | | | | | | Removing the stats make the whole cache structure fit in a single page. Bug: 131362671 Test: Verified that all bionic malloc benchmarks are still the same. Test: It turns out that the malloc_sql benchmarks seem to get faster. Test: Verified that after this change, it saves about 2K PSS per thread. Change-Id: I4dcd633543f05f1a9d47db175f9977ddb42188a9 (cherry picked from commit a8b52518654725e64def5ebbd0ed472100e5a522)
* Fix bug trying to examine unused extents.Christopher Ferris2019-03-221-2/+7
| | | | | | | | | Bug: 124264835 Test: Ran bionic unit tests. Test: Ran dumpsys -t 6000 meminfo --unreachable of chrome process without Test: crashing. Change-Id: I2cc66e443fa278621b9878a888c74f38efcb79eb
* Remove best fit for extent selection.Christopher Ferris2019-03-181-0/+16
| | | | | | | | | | | | | | | | | | | A jemalloc user reported that the best fit selection is causing them a memory leak. This code has been completely removed from the next release of jemalloc (5.2.0), so remove it since it doesn't have any real benefit. See https://github.com/jemalloc/jemalloc/issues/1454 Running the memory dumps, removing best fit appears to be a win: it is slightly faster and has the same PSS/VA. Bug: 128697497 Test: Ran jemalloc unit tests. Test: Ran memory dumps in 32 bit and 64 bit and observed that the PSS Test: and VA stayed the same, while run time improved slightly. Change-Id: I98a8ddf2cea837c8ade1afd4a998960c253d3932
* Ignore extents that are not associated with a size.Christopher Ferris2018-11-281-1/+2
| | | | | | | | Bug: 120032857 Test: Passes unit tests. Test: Ran dumpsys -t 300 meminfo --unreachable -a without crashes. Change-Id: I3d784ed2b449970966403bed7d701e2ff7434fba
* Fix mallinfo counting for large allocations.Christopher Ferris2018-11-261-1/+14
| | | | | | | | | | The lstats part of the arena structure was not being countered at all, so added that counting for mallinfo. Bug: 119580449 Test: New unit tests pass, without changes, the test fails. Change-Id: I97b231f9189a79f0ce0f55fe6c4cc00266ca75ac
* Further updates to jemalloc code.Christopher Ferris2018-11-015-9/+69
| | | | | | | | | | | | Add support for svelte. Add je_iterate support. Update some of the internals so that bad pointers in je_iterate do not crash. Test: Ran new bionic unit tests, ran libmemunreachable tests, booted system. Change-Id: I04171cf88df16d8dc2c2ebb60327e58b915b9d83
* Add android extensions.master-cuttlefish-testing-releaseChristopher Ferris2018-09-145-0/+214
| | | | | | | | | Bug: 62621531 Bug: 110158834 Test: Ran unit tests and benchmarks using libc. Change-Id: Ie13ab8510c42f96b58496b0ab7e4f8c3a9cd2c6d
* Mallctl: Add arenas.lookupLatchesar Ionkov2018-05-011-1/+33
| | | | | Implement a new mallctl operation that allows looking up the arena a region of memory belongs to.
* Remove an incorrect assertion.Qi Wang2018-04-181-1/+4
| | | | | Background threads are created without holding the global background_thread lock, which mean paused state is possible (and fine).
* Invoke dlsym() on demand.Qi Wang2018-04-181-11/+24
| | | | | If no lazy lock or background thread is enabled, avoid dlsym pthread_create on boot.
* Avoid a resource leak down extent split failure paths.David Goldblatt2018-04-181-10/+8
| | | | | | Previously, we would leak the extent and memory associated with a salvageable portion of an extent that we were trying to split in three, in the case where the first split attempt succeeded and the second failed.
* Fix abort_conf processing.Qi Wang2018-04-171-6/+4
| | | | | When abort_conf is set, make sure we always error out at the end of the options processing loop.
* Add UNUSED to avoid compiler warnings.Qi Wang2018-04-163-25/+24
|
* Allow setting extent hooks on uninitialized auto arenas.Qi Wang2018-04-111-12/+33
| | | | | Setting extent hooks can result in initializing an unused auto arena. This is useful to install extent hooks on auto arenas from the beginning.
* Silence a compiler warning.Jason Evans2018-04-101-2/+3
|
* background_thread: add max thread count configDave Watson2018-04-103-20/+103
| | | | | Looking at the thread counts in our services, jemalloc's background thread is useful, but mostly idle. Add a config option to tune down the number of threads.
* Stack address should not be used for ordering mutexesRajeev Misra2018-04-101-1/+1
|
* Fix type warning on Windows.Qi Wang2018-04-093-30/+7
| | | | Add cast since read / write has unsigned return type on windows.
* Fix arguments passed to extent_init.Qi Wang2018-04-091-1/+1
|
* Control idump and gdump with prof_active.Qi Wang2018-04-091-2/+2
|
* extents: Remove preserve_lru feature.Dave Watson2018-04-021-46/+18
| | | | | | | | preserve_lru feature adds lots of complication, for little value. Removing it means merged extents are re-added to the lru list, and may take longer to madvise away than they otherwise would. Canaries after removal seem flat for several services (no change).
* Fix a background_thread shutdown issue.Qi Wang2018-04-021-21/+26
| | | | | 1) make sure background thread 0 is always created; and 2) fix synchronization between thread 0 and the control thread.
* Change mutable option output in stats to avoid stringify issues.Qi Wang2018-03-151-36/+37
|
* Fix a typo in stats.Qi Wang2018-03-151-1/+1
|
* Stats printing: Convert arena large stats to use emitter.David Goldblatt2018-03-091-49/+58
| | | | This completes the conversion; we now have only structured text output.
* Stats printing: convert arena bin stats to use emitter.David Goldblatt2018-03-091-148/+182
|
* Stats printing: remove a spurious newline.David Goldblatt2018-03-091-3/+0
| | | | | This was left over from a previous emitter conversion. It didn't affect the correctness of the output.
* Stats printing: Make arena mutex stats use the emitter.David Goldblatt2018-03-091-98/+72
|
* Stats printing: convert most per-arena stats to use the emitter.David Goldblatt2018-03-091-69/+45
|
* Stats printing: convert paging and alloc counts to use the emitter.David Goldblatt2018-03-091-67/+81
|
* Stats printing: convert decay stats to use the emitter.David Goldblatt2018-03-091-73/+132
|
* Stats printing: Move emitter cutoff point into stats_arena_print.David Goldblatt2018-03-091-13/+12
|
* Stats printing: move stats_print_helper to use emitter.David Goldblatt2018-03-091-102/+61
|
* Stats printing: Move global mutex stats to use emitter.David Goldblatt2018-03-091-43/+97
|
* Stats printing: move non-mutex arena stats to the emitter.David Goldblatt2018-03-091-54/+43
| | | | | Another step in the conversion process. The mutex is a little different, because we we want to emit it as an array.
* Stats printing: Remove explicit callback passing to stats_print_helper.David Goldblatt2018-03-091-5/+12
| | | | | This makes the emitter the only source of callback information, which is a step towards where we want to be.
* Stats printing: Move emitter -> manual cutoff point.David Goldblatt2018-03-091-18/+11
| | | | | This makes it so that the "general" portion of the stats code is completely agnostic to emitter type.
* Stats printing: Convert profiling stats to use the emitter.David Goldblatt2018-03-091-31/+28
| | | | While we're at it, print them in table form, too.
* Stats printing: Convert general arena stats to use the emitter.David Goldblatt2018-03-091-82/+64
|
* Stats printing: convert config and opt output to use emitter.David Goldblatt2018-03-091-180/+107
| | | | This is a step along the path towards using the emitter for all stats output.
* Stats printing: Convert header and footer to use emitter.David Goldblatt2018-03-091-15/+13
|
* Add opt.thp which allows explicit hugepage usage.Qi Wang2018-03-086-26/+105
| | | | | | | | "always" marks all user mappings as MADV_HUGEPAGE; while "never" marks all mappings as MADV_NOHUGEPAGE. The default setting "default" does not change any settings. Note that all the madvise calls are part of the default extent hooks by design, so that customized extent hooks have complete control over the mappings including hugepage settings.
* Remove config.thp which wasn't in use.Qi Wang2018-03-082-4/+0
|
* Background threads: fix an indexing bug.David Goldblatt2018-02-271-1/+2
| | | | | | We have a buffer overrun that manifests in the case where arena indices higher than the number of CPUs are accessed before arena indices lower than the number of CPUs. This fixes the bug and adds a test.
* Modify configure to determine return value of strerror_r.Christopher Ferris2018-01-101-1/+1
| | | | | | | | On glibc and Android's bionic, strerror_r returns char* when _GNU_SOURCE is defined. Add a configure check for this rather than assume glibc is the only libc that behaves this way.
* Improve the fit for aligned allocation.Qi Wang2018-01-051-10/+61
| | | | | | | We compute the max size required to satisfy an alignment. However this can be quite pessimistic, especially with frequent reuse (and combined with state-based fragmentation). This commit adds one more fit step specific to aligned allocations, searching in all potential fit size classes.
* handle 32 bit mutex countersRajeev Misra2018-01-041-36/+47
|
* Implement arena regind computation using div_info_t.David Goldblatt2017-12-211-17/+16
| | | | | This eliminates the need to generate an enormous switch statement in arena_slab_regind.
* Add the div module, which allows fast division by dynamic values.David Goldblatt2017-12-212-1/+57
|