summaryrefslogtreecommitdiffstats
path: root/src/stats.c
Commit message (Collapse)AuthorAgeFilesLines
* handle 32 bit mutex countersRajeev Misra2018-01-041-36/+47
|
* Output opt.lg_extent_max_active_fit in stats.Qi Wang2017-12-141-0/+3
|
* Output all counters for bin mutex stats.Qi Wang2017-10-191-4/+7
| | | | The saved space is not worth the trouble of missing counters.
* Add stats for metadata_thp.Qi Wang2017-08-301-4/+18
| | | | Report number of THPs used in arena and aggregated stats.
* Change opt.metadata_thp to [disabled,auto,always].Qi Wang2017-08-301-1/+1
| | | | | | | | To avoid the high RSS caused by THP + low usage arena (i.e. THP becomes a significant percentage), added a new "auto" option which will only start using THP after a base allocator used up the first THP region. Starting from the second hugepage (in a single arena), "auto" behaves the same as "always", i.e. madvise hugepage right away.
* Implement opt.metadata_thpQi Wang2017-08-111-0/+1
| | | | | This option enables transparent huge page for base allocators (require MADV_HUGEPAGE support).
* Output total_wait_ns for bin mutexes.Qi Wang2017-05-311-19/+5
|
* Add the --disable-thp option to support cross compiling.Jason Evans2017-05-301-0/+1
| | | | This resolves #669.
* Add opt.stats_print_opts.Qi Wang2017-05-291-42/+19
| | | | The value is passed to atexit(3)-triggered malloc_stats_print() calls.
* Added opt_abort_conf: abort on invalid config options.Qi Wang2017-05-271-0/+1
|
* Header refactoring: unify and de-catchall mutex moduleDavid Goldblatt2017-05-241-0/+1
|
* Add background thread related stats.Qi Wang2017-05-231-1/+39
|
* Implementing opt.background_thread.Qi Wang2017-05-231-0/+1
| | | | | | | | | | | Added opt.background_thread to enable background threads, which handles purging currently. When enabled, decay ticks will not trigger purging (which will be left to the background threads). We limit the max number of threads to NCPUs. When percpu arena is enabled, set CPU affinity for the background threads as well. The sleep interval of background threads is dynamic and determined by computing number of pages to purge in the future (based on backlog).
* Refactor *decay_time into *decay_ms.Jason Evans2017-05-181-27/+15
| | | | | | | | Support millisecond resolution for decay times. Among other use cases this makes it possible to specify a short initial dirty-->muzzy decay phase, followed by a longer muzzy-->clean decay phase. This resolves #812.
* Add stats: arena uptime.Qi Wang2017-05-181-0/+10
|
* Refactor !opt.munmap to opt.retain.Jason Evans2017-04-291-1/+1
|
* Header refactoring: ctl - unify and remove from catchall.David Goldblatt2017-04-251-28/+30
| | | | | In order to do this, we introduce the mutex_prof module, which breaks a circular dependency between ctl and prof.
* Replace --disable-munmap with opt.munmap.Jason Evans2017-04-251-1/+1
| | | | | | | | | Control use of munmap(2) via a run-time option rather than a compile-time option (with the same per platform default). The old behavior of --disable-munmap can be achieved with --with-malloc-conf=munmap:false. This partially resolves #580.
* Remove --disable-tls.Jason Evans2017-04-211-1/+0
| | | | | | | This option is no longer useful, because TLS is correctly configured automatically on all supported platforms. This partially resolves #580.
* Remove --disable-tcache.Jason Evans2017-04-211-83/+31
| | | | | | | | | | | Simplify configuration by removing the --disable-tcache option, but replace the testing for that configuration with --with-malloc-conf=tcache:false. Fix the thread.arena and thread.tcache.flush mallctls to work correctly if tcache is disabled. This partially resolves #580.
* Output 4 counters for bin mutexes instead of just 2.Qi Wang2017-04-191-8/+24
|
* Header refactoring: move assert.h out of the catch-allDavid Goldblatt2017-04-191-0/+2
|
* Header refactoring: Split up jemalloc_internal.hDavid Goldblatt2017-04-111-1/+2
| | | | | | | | | | | | | | This is a biggy. jemalloc_internal.h has been doing multiple jobs for a while now: - The source of system-wide definitions. - The catch-all include file. - The module header file for jemalloc.c This commit splits up this functionality. The system-wide definitions responsibility has moved to jemalloc_preamble.h. The catch-all include file is now jemalloc_internal_includes.h. The module headers for jemalloc.c are now in jemalloc_internal_[externs|inlines|types].h, just as they are for the other modules.
* Refactor mutex profiling code with x-macros.Qi Wang2017-03-231-82/+117
|
* Added "stats.mutexes.reset" mallctl to reset all mutex stats.Qi Wang2017-03-231-73/+74
| | | | Also switched from the term "lock" to "mutex".
* Added JSON output for lock stats.Qi Wang2017-03-231-41/+113
| | | | Also added option 'x' to malloc_stats() to bypass lock section.
* Added lock profiling and output for global locks (ctl, prof and base).Qi Wang2017-03-231-21/+53
|
* Add arena lock stats output.Qi Wang2017-03-231-14/+68
|
* Output bin lock profiling results to malloc_stats.Qi Wang2017-03-231-33/+66
| | | | | Two counters are included for the small bins: lock contention rate, and max lock waiting time.
* Implement two-phase decay-based purging.Jason Evans2017-03-151-27/+72
| | | | | | | | | | | | | | | | | | | | Split decay-based purging into two phases, the first of which uses lazy purging to convert dirty pages to "muzzy", and the second of which uses forced purging, decommit, or unmapping to convert pages to clean or destroy them altogether. Not all operating systems support lazy purging, yet the application may provide extent hooks that implement lazy purging, so care must be taken to dynamically omit the first phase when necessary. The mallctl interfaces change as follows: - opt.decay_time --> opt.{dirty,muzzy}_decay_time - arena.<i>.decay_time --> arena.<i>.{dirty,muzzy}_decay_time - arenas.decay_time --> arenas.{dirty,muzzy}_decay_time - stats.arenas.<i>.pdirty --> stats.arenas.<i>.p{dirty,muzzy} - stats.arenas.<i>.{npurge,nmadvise,purged} --> stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged} This resolves #521.
* Implement per-CPU arena.Qi Wang2017-03-091-0/+1
| | | | | | | | | | | | | | | | | | The new feature, opt.percpu_arena, determines thread-arena association dynamically based CPU id. Three modes are supported: "percpu", "phycpu" and disabled. "percpu" uses the current core id (with help from sched_getcpu()) directly as the arena index, while "phycpu" will assign threads on the same physical CPU to the same arena. In other words, "percpu" means # of arenas == # of CPUs, while "phycpu" has # of arenas == 1/2 * (# of CPUs). Note that no runtime check on whether hyper threading is enabled is added yet. When enabled, threads will be migrated between arenas when a CPU change is detected. In the current design, to reduce overhead from reading CPU id, each arena tracks the thread accessed most recently. When a new thread comes in, we will read CPU id and update arena if necessary.
* Handle race in stats_arena_bins_printQi Wang2017-02-011-2/+11
| | | | | | | When multiple threads calling stats_print, race could happen as we read the counters in separate mallctl calls; and the removed assertion could fail when other operations happened in between the mallctl calls. For simplicity, output "race" in the utilization field in this case.
* Replace tabs following #define with spaces.Jason Evans2017-01-211-11/+11
| | | | This resolves #564.
* Update brace style.Jason Evans2017-01-211-21/+24
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Test JSON output of malloc_stats_print() and fix bugs.Jason Evans2017-01-191-28/+37
| | | | | | | | Implement and test a JSON validation parser. Use the parser to validate JSON output from malloc_stats_print(), with a significant subset of supported output options. This resolves #551.
* Added stats about number of bytes cached in tcache currently.Qi Wang2017-01-181-0/+13
|
* Implement arena.<i>.destroy .Jason Evans2017-01-071-4/+33
| | | | | | | Add MALLCTL_ARENAS_DESTROYED for accessing destroyed arena stats as an analogue to MALLCTL_ARENAS_ALL. This resolves #382.
* Replace the arenas.initialized mallctl with arena.<i>.initialized .Jason Evans2017-01-071-4/+8
|
* Add MALLCTL_ARENAS_ALL.Jason Evans2017-01-071-1/+1
| | | | | | | Add the MALLCTL_ARENAS_ALL cpp macro as a fixed index for use in accessing the arena.<i>.{purge,decay,dss} and stats.arenas.<i>.* mallctls, and deprecate access via the arenas.narenas index (to be removed in 6.0.0).
* Implement per arena base allocators.Jason Evans2016-12-271-4/+23
| | | | | | | | | | | | | Add/rename related mallctls: - Add stats.arenas.<i>.base . - Rename stats.arenas.<i>.metadata to stats.arenas.<i>.internal . - Add stats.arenas.<i>.resident . Modify the arenas.extend mallctl to take an optional (extent_hooks_t *) argument so that it is possible for all base allocations to be serviced by the specified extent hooks. This resolves #463.
* Fix JSON-mode output for !config_stats and/or !config_prof cases.Jason Evans2016-12-231-10/+11
| | | | | | | These bugs were introduced by 0ba5b9b6189e16a983d8922d8c5cb6ab421906e8 (Add "J" (JSON) support to malloc_stats_print().), which was backported as b599b32280e1142856b0b96293a71e1684b1ccfb (with the same bugs except the inapplicable "metatata" misspelling) and first released in 4.3.0.
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-11-151-3/+4
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* malloc_stats_print() fixes/cleanups.Jason Evans2016-11-011-18/+3
| | | | | | Fix and clean up various malloc_stats_print() issues caused by 0ba5b9b6189e16a983d8922d8c5cb6ab421906e8 (Add "J" (JSON) support to malloc_stats_print().).
* Add "J" (JSON) support to malloc_stats_print().Jason Evans2016-11-011-313/+716
| | | | This resolves #474.
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-10-281-18/+26
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* Remove all vestiges of chunks.Jason Evans2016-10-121-11/+0
| | | | | | | | Remove mallctls: - opt.lg_chunk - stats.cactive This resolves #464.
* Remove ratio-based purging.Jason Evans2016-10-121-42/+10
| | | | | | | | | | | | | Make decay-based purging the default (and only) mode. Remove associated mallctls: - opt.purge - opt.lg_dirty_mult - arena.<i>.lg_dirty_mult - arenas.lg_dirty_mult - stats.arenas.<i>.lg_dirty_mult This resolves #385.
* Remove obsolete stats.arenas.<i>.metadata.mapped mallctl.Jason Evans2016-06-061-9/+4
| | | | | Rename stats.arenas.<i>.metadata.allocated mallctl to stats.arenas.<i>.metadata .
* Rename huge to large.Jason Evans2016-06-061-35/+36
|
* Move slabs out of chunks.Jason Evans2016-06-061-22/+23
|