summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev'5.2.1Qi Wang2019-08-0562-373/+1829
|\
| * Update Changelog for 5.2.1.Qi Wang2019-08-051-0/+33
| |
| * Sanity check on prof dump buffer size.Qi Wang2019-08-021-0/+1
| |
| * Quick fix for prof log printingYinan Zhang2019-07-311-2/+2
| | | | | | | | | | The emitter APIs used were incorrect, a side effect of which was extra lines being printed.
| * Workaround to address g++ unused variable warningsYinan Zhang2019-07-301-2/+4
| | | | | | | | | | | | g++ 5.5.0+ complained `parameter ‘expected’ set but not used [-Werror=unused-but-set-parameter]` (despite that `expected` is in fact used).
| * Limit to exact fit on Windows with retain off.Qi Wang2019-07-291-0/+10
| | | | | | | | | | | | W/o retain, split and merge are disallowed on Windows. Avoid doing first-fit which needs splitting almost always. Instead, try exact fit only and bail out early.
| * Revert "Refactor prof log"Qi Wang2019-07-298-720/+677
| | | | | | | | This reverts commit 7618b0b8e458d9c0db6e4b05ccbe6c6308952890.
| * Revert "Refactor profiling"Qi Wang2019-07-298-1501/+1450
| | | | | | | | This reverts commit 0b462407ae84a62b3c097f0e9f18df487a47d9a7.
| * Refactor profilingYinan Zhang2019-07-298-1450/+1501
| | | | | | | | | | | | | | | | | | | | Refactored core profiling codebase into two logical parts: (a) `prof_data.c`: core internal data structure managing & dumping; (b) `prof.c`: mutexes & outward-facing APIs. Some internal functions had to be exposed out, but there are not that many of them if the modularization is (hopefully) clean enough.
| * Refactor prof logYinan Zhang2019-07-298-677/+720
| | | | | | | | | | | | `prof.c` is growing too long, so trying to modularize it. There are a few internal functions that had to be exposed but I think it is a fair trade-off.
| * Add indent to individual options for confirm_conf.Qi Wang2019-07-261-3/+4
| |
| * Update manual for opt.retain (new default on Windows).Qi Wang2019-07-251-11/+11
| |
| * Lower nthreads in test/unit/retained on 32-bit to avoid OOM.Qi Wang2019-07-251-0/+3
| |
| * Refactor arena_dalloc() / _sdalloc().Qi Wang2019-07-251-24/+18
| |
| * Invoke arena_dalloc_promoted() properly w/o tcache.Qi Wang2019-07-252-5/+13
| | | | | | | | When tcache was disabled, the dalloc promoted case was missing.
| * Optimize max_active_fit in first_fit.Qi Wang2019-07-241-4/+2
| | | | | | | | Stop scanning once reached the first max_active_fit size.
| * Track the leaked VM space via the abandoned_vm counter.Qi Wang2019-07-245-5/+26
| | | | | | | | | | The counter is 0 unless metadata allocation failed (indicates OOM), and is mainly for sanity checking.
| * extent_dalloc instead of leak when register fails.Qi Wang2019-07-241-6/+3
| | | | | | | | | | | | extent_register may only fail if the underlying extent and region got stolen / coalesced before we lock. Avoid doing extent_leak (which purges the region) since we don't really own the region.
| * Avoid leaking extents / VM when split is not supported.Qi Wang2019-07-241-0/+11
| | | | | | | | | | | | This can only happen on Windows and with opt.retain disabled (which isn't the default). The solution is suboptimal, however not a common case as retain is the long term plan for all platforms anyway.
| * Enable opt.retain by default on Windows.Qi Wang2019-07-241-0/+3
| |
| * Implement retain on Windows.Qi Wang2019-07-248-28/+110
| | | | | | | | | | | | | | | | | | | | | | The VirtualAlloc and VirtualFree APIs are different because MEM_DECOMMIT cannot be used across multiple VirtualAlloc regions. To properly support decommit, only allow merge / split within the same region -- this is done by tracking the "is_head" state of extents and not merging cross-region. Add a new state is_head (only relevant for retain && !maps_coalesce), which is true for the first extent in each VirtualAlloc region. Determine if two extents can be merged based on the head state, and use serial numbers for sanity checks.
| * Fix posix_memalign with input size 0.Qi Wang2019-07-182-7/+20
| | | | | | | | Return a valid pointer instead of failed assertion.
| * Remove prof_accumbytes in arenaYinan Zhang2019-07-161-1/+0
| | | | | | | | | | `prof_accumbytes` was supposed to be replaced by `prof_accum` in https://github.com/jemalloc/jemalloc/pull/623.
| * Fix a bug in prof_dump_writeYinan Zhang2019-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The original logic can be disastrous if `PROF_DUMP_BUFSIZE` is less than `slen` -- `prof_dump_buf_end + slen <= PROF_DUMP_BUFSIZE` would always be `false`, so `memcpy` would always try to copy `PROF_DUMP_BUFSIZE - prof_dump_buf_end` chars, which can be dangerous: in the last round of the `while` loop it would not only illegally read the memory beyond `s` (which might not always be disastrous), but it would also illegally overwrite the memory beyond `prof_dump_buf` (which can be pretty disastrous). `slen` probably has never gone beyond `PROF_DUMP_BUFSIZE` so we were just lucky.
| * Fix logic in printingYinan Zhang2019-07-163-3/+2
| | | | | | | | | | | | `cbopaque` can now be overriden without overriding `write_cb` in the first place. (Otherwise there would be no need to have the `cbopaque` parameter in `malloc_message`.)
| * Reorder the configs for AppVeyor.Qi Wang2019-07-151-8/+8
| | | | | | | | Enable-debug and 64-bit runs tend to be more relevant. Run them first.
| * Fix redzone setting and checkingYinan Zhang2019-07-121-2/+2
| |
| * Add missing safety_check.c to MSBuild projectsfrederik-h2019-05-244-4/+12
| | | | | | | | | | | | The file is included in the list of source files in Makefile.in, but it is missing from the project files. This causes the build to fail due to unresolved symbols.
| * Avoid blocking on background thread lock for stats.Qi Wang2019-05-221-1/+7
| | | | | | | | | | | | Background threads may run for a long time, especially when the # of dirty pages is high. Avoid blocking stats calls because of this (which may cause latency spikes).
| * Add experimental.arenas.i.pactivep.Qi Wang2019-05-221-7/+82
| | | | | | | | | | | | | | The new experimental mallctl exposes the arena pactive counter to applications, which allows fast read w/o going through the mallctl / epoch steps. This is particularly useful when frequent balancing is required, e.g. when having multiple manual arenas, and threads are multiplexed to them based on usage.
| * Add confirm_conf optionYinan Zhang2019-05-226-107/+196
| | | | | | | | | | | | If the confirm_conf option is set, when the program starts, each of the four malloc_conf strings will be printed, and each option will be printed when being set.
| * Improve memory utilization testsYinan Zhang2019-05-212-121/+200
| | | | | | | | | | Added tests for large size classes and expanded the tests to cover wider range of allocation sizes.
| * Fix GCC-9.1 warning with macro GET_ARG_NUMERICVaibhav Jain2019-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC-9.1 reports following error when trying to compile file src/malloc_io.c and with CFLAGS='-Werror' : src/malloc_io.c: In function ‘malloc_vsnprintf’: src/malloc_io.c:369:2: error: case label value exceeds maximum value for type [-Werror] 369 | case '?' | 0x80: \ | ^~~~ src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’ 581 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ ... <snip> cc1: all warnings being treated as errors make: *** [Makefile:388: src/malloc_io.sym.o] Error 1 The warning is reported as by default the type 'char' is 'signed char' and or-ing 0x80 will turn the case label char negative which will be beyond the printable ascii range (0 - 127). The patch fixes this by explicitly casting the 'len' variable as unsigned char' inside the 'switch' statement so that value of expression " '?' | 0x80 " falls within the legal values of the variable 'len'.
| * Track nfills and nflushes for arenas.i.small / large.Qi Wang2019-05-157-14/+138
| | | | | | | | | | | | Small is added purely for convenience. Large flushes wasn't tracked before and can be useful in analysis. Large fill simply reports nmalloc, since there is no batch fill for large currently.
| * Fix assert in free fastpathYinan Zhang2019-05-151-1/+1
| | | | | | | | | | rtree_szind_slab_read_fast() may have not initialized alloc_ctx.szind, unless after confirming the return is true.
| * Improve macro readability in malloc_conf_initYinan Zhang2019-05-081-22/+22
| | | | | | | | Define more readable macros than yes and no.
| * Remove best fitDave Watson2019-05-081-32/+8
| | | | | | | | | | | | | | | | This option saves a few CPU cycles, but potentially adds a lot of fragmentation - so much so that there are workarounds like max_active. Instead, let's just drop it entirely. It only made a difference in one service I tested (.3% cpu regression), while many services saw a memory win (also small, less than 1% mem P99)
| * Add max_active_fit to first_fitDave Watson2019-05-081-1/+10
| | | | | | | | | | The max_active_fit check is currently only on the best_fit path, add it to the first_fit path also.
| * Add nonfull_slabs to bin_stats_t.Doron Roberts-Kedes2019-04-297-1/+42
| | | | | | | | | | | | | | When config_stats is enabled track the size of bin->slabs_nonfull in the new nonfull_slabs counter in bin_stats_t. This metric should be useful for establishing an upper ceiling on the savings possible by meshing.
| * Improve size class headerYinan Zhang2019-04-241-8/+21
| | | | | | | | | | | | Mainly fixing typos. The only non-trivial change is in the computation for SC_NPSIZES, though the result wouldn't be any different when SC_NGROUP = 4 as is always the case at the moment.
| * configure.ac: Add an option to disable docFabrice Fontaine2019-04-232-1/+20
| | | | | | | | Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
| * Fix typo derived from tcmalloc's pprof2019-04-231-1/+1
| | | | | | | | | | The same pr is submitted into gperftools: https://github.com/gperftools/gperftools/pull/1105
| * Enforce TLS_MODEL attribute.Qi Wang2019-04-163-6/+10
| | | | | | | | | | Caught by @zoulasc in #1460. The attribute needs to be added in the headers as well.
| * Safety checks: Run tests by defaultDavid Goldblatt2019-04-153-0/+27
| |
| * Safety checks: Add a redzoning feature.David Goldblatt2019-04-1512-19/+230
| |
| * Safety checks: Indirect through a function.David Goldblatt2019-04-154-1/+20
| | | | | | | | This will let us share code on failure pathways.pathways
| * Safety checks: Expose config value via mallctl and stats.David Goldblatt2019-04-152-0/+4
| |
| * Move extra size checks behind a config flag.David Goldblatt2019-04-154-22/+40
| | | | | | | | | | This will let us turn that flag into a generic "turn on runtime checks" flag that guards other functionality we have planned.
| * Add an autoconf feature test for format_arg and a jemalloc-specificzoulasc2019-04-154-1/+22
| | | | | | | | macro for it.
| * Fix incorrect macro use.zoulasc2019-04-151-1/+1
| | | | | | | | Compiling with warnings produces missing prototype warnings.