summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable builtin malloc in testsdivanorama2022-10-031-0/+2
| | | | | | | | | | | With `--with-jemalloc-prefix=` and without `-fno-builtin` or `-O1` both clang and gcc may optimize out `malloc` calls whose result is unused. Comparing result to NULL also doesn't necessarily count as being used. This won't be a problem in most client programs as this only concerns really unused pointers, but in tests it's important to actually execute allocations. `-fno-builtin` should disable this optimization for both gcc and clang, and applying it only to tests code shouldn't hopefully be an issue. Another alternative is to force "use" of result but that'd require more changes and may miss some other optimization-related issues. This should resolve https://github.com/jemalloc/jemalloc/issues/2091
* Add vcpkg installation instructionsLily Wang2022-09-191-0/+17
|
* Fix a bug in C++ integration test.Guangli Dai2022-09-161-2/+1
|
* Add arena-level name.Guangli Dai2022-09-168-9/+146
| | | | An arena-level name can help identify manual arenas.
* Making jemalloc max stack depth a runtime optionGuangli Dai2022-09-1212-11/+171
|
* error: implicit declaration of function 'pthread_create_fptr_init' is ↵Abael He2022-09-071-33/+33
| | | | | | | | | | | | | | | | | | | | invalid in C99 ./autogen.sh \ && ./configure --prefix=/usr/local --enable-static --enable-autogen --enable-xmalloc --with-static-libunwind=/usr/local/lib/libunwind.a --enable-lazy-lock --with-jemalloc-prefix='' \ && make -j16 ... gcc -std=gnu11 -Werror=unknown-warning-option -Wall -Wextra -Wshorten-64-to-32 -Wsign-compare -Wundef -Wno-format-zero-length -Wpointer-arith -Wno-missing-braces -Wno-missing-field-initializers -pipe -g3 -Wimplicit-fallthrough -O3 -funroll-loops -fPIC -DPIC -c -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/edata_cache.sym.o src/edata_cache.c src/background_thread.c:768:6: error: implicit declaration of function 'pthread_create_fptr_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_create_fptr_init()) { ^ src/background_thread.c:768:6: note: did you mean 'pthread_create_wrapper_init'? src/background_thread.c:34:1: note: 'pthread_create_wrapper_init' declared here pthread_create_wrapper_init(void) { ^ 1 error generated. make: *** [src/background_thread.sym.o] Error 1 make: *** Waiting for unfinished jobs....
* Refactor the remote / cross thread cache bin stats readingGuangli Dai2022-09-062-52/+51
| | | | Refactored cache_bin.h so that only one function is racy.
* Add double free detection using slab bitmap for debug buildGuangli Dai2022-09-062-25/+96
| | | | Add a sanity check for double free issue in the arena in case that the tcache has been flushed.
* Add double free detection in thread cache for debug buildIvan Zaitsev2022-08-048-9/+97
| | | | | | Add new runtime option `debug_double_free_max_scan` that specifies the max number of stack entries to scan in the cache bit when trying to detect the double free bug (currently debug build only).
* update travisDavid CARLIER2022-07-192-1/+3
|
* enabled percpu_arena settings on macOs.David CARLIER2022-07-191-1/+1
| | | | follow-up on #2280
* OpenBSD build fix. still no cpu affinity.David Carlier2022-07-193-2/+6
| | | | | - enabling pthread_get/pthread_set_name_np api. - disabling per thread cpu affinity handling, unsupported on this platform.
* Add the missing opt.cache_oblivious handling.Qi Wang2022-07-141-0/+1
|
* Remove duplicated words in documentationJasmin Parent2022-07-111-3/+1
|
* Fix possible "nmalloc >= ndalloc" assertionAzat Khuzhin2022-07-111-6/+9
| | | | | | | | | | | | | | | In arena_stats_merge() first nmalloc was read, and after ndalloc. However with this order, it is possible for some thread to incement ndalloc in between, and then nmalloc < ndalloc, and assertion will fail, like again found by ClickHouse CI [1] (even after #2234). [1]: https://github.com/ClickHouse/ClickHouse/issues/31531 Swap the order to avoid possible assertion. Cc: @interwq Follow-up for: #2234
* CI update FreeBSD version.David CARLIER2022-06-281-1/+1
|
* Update building for Windows instructionsAlex Lapenkou2022-06-142-23/+79
| | | | | Explain how to build for Windows in INSTALL.md and remove another readme.txt in an obscure location.
* New configure option '--enable-pageid' for LinuxDavid Carlier2022-06-093-0/+59
| | | | | | | The option makes jemalloc use prctl with PR_SET_VMA to tag memory mappings with "jemalloc_pg" or "jemalloc_pg_overcommit". This allows to easily identify jemalloc's mappings in /proc/<pid>/maps. PR_SET_VMA is only available in Linux 5.17 and above.
* Enable retain by default on macOS.Qi Wang2022-06-091-0/+3
| | | | | High number of mappings result in unusually high fork() cost on macOS. Retain fixes the issue, at a small cost of extra VM space reserved.
* Implement malloc_getcpu for amd64 and arm64 macOSDavid Carlier2022-06-082-0/+26
| | | | This enables per CPU arena on MacOS
* Revert "Echo installed files via verbose 'install' command"Alex Lapenkou2022-06-071-7/+13
| | | | | This reverts commit f15d8f3b416f6812ac030bc1a7aacf05927a4d7f. "install -v" turned out to be not portable and not work on NetBSD.
* jemalloc: fix PowerPC definitions in quantum.hbarracuda1562022-05-261-1/+1
|
* Implement pvalloc replacementAlex Lapenkou2022-05-187-0/+75
| | | | | Despite being an obsolete function, pvalloc is still present in GLIBC and should work correctly when jemalloc replaces libc allocator.
* Improve the failure message upon opt_experimental_infallible_new.Qi Wang2022-05-172-4/+10
|
* Fix compiling edata.h with MSVCYuriy Chernyshov2022-05-091-2/+4
| | | | | At the time an attempt to compile jemalloc 5.3.0 with MSVC 2019 results in the followin error message: > jemalloc/include/jemalloc/internal/edata.h:660: error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
* Merge branch 'dev'5.3.0masterQi Wang2022-05-06379-17135/+45977
|\
| * Update ChangeLog for 5.3.0.Qi Wang2022-05-061-0/+100
| |
| * Make the default option of zero realloc match the system allocator.Qi Wang2022-05-054-8/+26
| |
| * Make test/unit/background_thread_enable more conservative.Qi Wang2022-05-041-8/+19
| | | | | | | | To avoid resource exhaustion on 32-bit platforms.
| * Update TUNING.md to include the new tcache_max option.Qi Wang2022-05-041-4/+4
| |
| * Small doc tweak of opt.trust_madvise.Qi Wang2022-04-281-4/+3
| | | | | | | | Avoid quoted enabled and disabled because it's a bool type instead of char *.
| * Minor typo fix in doc.Qi Wang2022-04-271-1/+1
| |
| * Correct the name of stats.mutexes.prof_thds_data in doc.Qi Wang2022-04-251-1/+1
| |
| * Avoid abort() in test/integration/cpp/infallible_new_true.Qi Wang2022-04-254-46/+79
| | | | | | | | | | Allow setting the safety check abort hook through mallctl, which avoids abort() and core dumps.
| * fix some typoscuishuang2022-04-2510-11/+11
| | | | | | | | Signed-off-by: cuishuang <imcusg@gmail.com>
| * Rename zero_realloc option "strict" to "alloc".Qi Wang2022-04-207-16/+16
| | | | | | | | | | With realloc(ptr, 0) being UB per C23, the option name "strict" makes less sense now. Rename to "alloc" which describes the behavior.
| * Update FreeBSD image to 12.3 for cirrus ci.Qi Wang2022-04-191-1/+1
| |
| * Use volatile to workaround buffer overflow false positives.Qi Wang2022-04-041-5/+21
| | | | | | | | | | In test/integration/rallocx, full usable size is checked which may confuse overflow detection.
| * Reoreder TravisCI jobs to optimize CI timeAlex Lapenkou2022-03-292-77/+77
| | | | | | | | | | Sorting jobs by descending expected runtime helps to utilize concurrency better.
| * Enable TravisCI for WindowsAlex Lapenkou2022-03-292-1/+25
| |
| * Add FreeBSD to TravisCIAlex Lapenkou2022-03-295-0/+83
| | | | | | | | | | Implement the generation of Travis jobs for FreeBSD. The generated jobs replicate the existing CirrusCI config.
| * Do not disable SEC by default for 64k pages platformsAlex Lapenkou2022-03-242-2/+2
| | | | | | | | | | | | Default SEC max_alloc option value was 32k, disabling SEC for platforms with lg-page=16. This change enables SEC for all platforms, making minimum max_alloc value equal to PAGE.
| * Add comments and use meaningful vars in sz_psz2ind.Charles2022-03-245-10/+108
| |
| * Implement PAGE_FLOOR macroAlex Lapenkou2022-03-222-1/+4
| |
| * Fix size class calculation for secAlex Lapenkou2022-03-222-5/+9
| | | | | | | | | | | | Due to a bug in sec initialization, the number of cached size classes was equal to 198. The bug caused the creation of more than a hundred of unused bins, although it didn't affect the caching logic.
| * Add a default page size when cross-compile for Apple M1.Qi Wang2022-03-211-0/+9
| | | | | | | | | | When cross-compile for M1 and no page size specified, use the default 16K and skip detecting the page size (which is likely incorrect).
| * Fix FreeBSD system jemalloc TSD cleanupAlex Lapenkov2022-03-026-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, in case FreeBSD libc jemalloc was overridden by another jemalloc, proper thread shutdown callback was involved only for the overriding jemalloc. A call to _malloc_thread_cleanup from libthr would be redirected to user jemalloc, leaving data about dead threads hanging in system jemalloc. This change tackles the issue in two ways. First, for current and old system jemallocs, which we can not modify, the overriding jemalloc would locate and invoke system cleanup routine. For upcoming jemalloc integrations, the cleanup registering function will also be redirected to user jemalloc, which means that system jemalloc's cleanup routine will be registered in user's jemalloc and a single call to _malloc_thread_cleanup will be sufficient to invoke both callbacks.
| * Fix possible "nmalloc >= ndalloc" assertion.Azat Khuzhin2022-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that ndalloc will be updated before nmalloc, in arena_large_ralloc_stats_update(), fix this by reorder those calls. It was found by ClickHouse CI, that periodically hits this assertion [1]. [1]: https://github.com/ClickHouse/ClickHouse/issues/31531 That issue contains lots of examples, with core dump and some gdb output [2]. [2]: https://s3.amazonaws.com/clickhouse-test-reports/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/stress_test__debug__actions_.html Here you can find binaries for that particular report [3] you need clickhouse debug build [4]. [3]: https://s3.amazonaws.com/clickhouse-builds/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/clickhouse_build_check_(actions)/report.html [4]: https://s3.amazonaws.com/clickhouse-builds/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/package_debug/clickhouse Brief info from that report: 2 0x000000002ad6dbfe in arena_stats_merge (tsdn=0x7f2399abdd20, arena=0x7f241ce01080, nthreads=0x7f24e4360958, dss=0x7f24e4360960, dirty_decay_ms=0x7f24e4360968, muzzy_decay_ms=0x7f24e4360970, nactive=0x7f24e4360978, ndirty=0x7f24e43 e4360988, astats=0x7f24e4360998, bstats=0x7f24e4363310, lstats=0x7f24e4364990, estats=0x7f24e4366e50, hpastats=0x7f24e43693a0, secstats=0x7f24e436a020) at ../contrib/jemalloc/src/arena.c:138 ndalloc = 226 nflush = 0 curlextents = 0 nmalloc = 225 nrequests = 0 Here you can see that they differs only by 1. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
| * Fix failed assertion due to racy memory accessAlex Lapenkou2022-02-172-18/+63
| | | | | | | | | | | | | | | | | | | | While calculating the number of stashed pointers, multiple variables potentially modified by a concurrent thread were used for the calculation. This led to some inconsistencies, correctly detected by the assertions. The change eliminates some possible inconsistencies by using unmodified variables and only once a concurrently modified one. The assertions are omitted for the cases where we acknowledge potential inconsistencies too.
| * Properly detect background thread support on Darwin.Qi Wang2022-02-151-1/+2
| | | | | | | | | | When cross-compile, the host type / abi should be checked to determine background thread compatibility.