summaryrefslogtreecommitdiffstats
path: root/test/unit
Commit message (Collapse)AuthorAgeFilesLines
* Lower nthreads in test/unit/retained on 32-bit to avoid OOM.Qi Wang2019-07-251-0/+3
|
* Implement retain on Windows.Qi Wang2019-07-243-7/+13
| | | | | | | | | | | 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.
* Add confirm_conf optionYinan Zhang2019-05-221-0/+1
| | | | | | 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-211-117/+196
| | | | | Added tests for large size classes and expanded the tests to cover wider range of allocation sizes.
* Add nonfull_slabs to bin_stats_t.Doron Roberts-Kedes2019-04-291-1/+6
| | | | | | | 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.
* Safety checks: Add a redzoning feature.David Goldblatt2019-04-152-0/+161
|
* Separate tests for extent utilization APIYinan Zhang2019-04-102-195/+191
| | | | As title.
* Fix test/unit/prof_logQi Wang2019-04-051-5/+7
| | | | | Compiler optimizations may produce traces more than expected. Instead verify the lower bound only.
* Add memory utilization analytics to mallctlYinan Zhang2019-04-041-1/+195
| | | | | | The analytics tool is put under experimental.utilization namespace in mallctl. Input is one pointer or an array of pointers and the output is a list of memory utilization statistics.
* Fix the binshard unit test.Qi Wang2019-04-021-0/+3
| | | | | The test attempts to trigger usage of multiple sharded bins, which percpu_arena makes it less reliable.
* Eagerly purge oversized merged extents.Qi Wang2019-03-151-3/+9
| | | | This change improves memory usage slightly, at virtually no CPU cost.
* Rename huge_threshold to oversize_threshold.Qi Wang2019-01-252-3/+3
| | | | | The keyword huge tend to remind people of huge pages which is not relevent to the feature.
* Un-experimental the huge_threshold feature.Qi Wang2019-01-162-2/+2
|
* Add unit test for producer-consumer pattern.Qi Wang2018-12-181-2/+50
|
* Add unit test for sharded bins.Qi Wang2018-12-042-0/+106
|
* Add stats for arenas.bin.i.nshards.Qi Wang2018-12-041-0/+1
|
* Add unit tests for loggingTyler Etzel2018-08-012-0/+151
|
* Small refactoring of emitterTyler Etzel2018-08-011-19/+75
| | | | | | | - Make API more clear for using as standalone json emitter - Support cases that weren't possible before, e.g. - emitting primitive values in an array - emitting nested arrays
* SC: Remove global data.David Goldblatt2018-07-236-19/+19
| | | | | | | The global data is mostly only used at initialization, or for easy access to values we could compute statically. Instead of consuming that space (and risking TLB misses), we can just pass around a pointer to stack data during bootstrapping.
* SC: Make some key size classes static.David Goldblatt2018-07-135-10/+10
| | | | | | The largest small class, smallest large class, and largest large class may all be needed down fast paths; to avoid the risk of touching another cache line, we can make them available as constants.
* SC: Add page customization functionality.David T. Goldblatt2018-07-131-0/+33
|
* Add lg_ceil to bit_util.David Goldblatt2018-07-131-1/+55
| | | | Also, add the bit_util test back to the Makefile.
* Hide size class computation behind a layer of indirection.David Goldblatt2018-07-139-33/+41
| | | | | | | | | This class removes almost all the dependencies on size_classes.h, accessing the data there only via the new module sc.h, which does not depend on any configuration options. In a subsequent commit, we'll remove the configure-time size class computations, doing them at boot time, instead.
* Clean compilation -Wextragnzlbg2018-07-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit jemalloc produced many warnings when compiled with -Wextra with both Clang and GCC. This commit fixes the issues raised by these warnings or suppresses them if they were spurious at least for the Clang and GCC versions covered by CI. This commit: * adds `JEMALLOC_DIAGNOSTIC` macros: `JEMALLOC_DIAGNOSTIC_{PUSH,POP}` are used to modify the stack of enabled diagnostics. The `JEMALLOC_DIAGNOSTIC_IGNORE_...` macros are used to ignore a concrete diagnostic. * adds `JEMALLOC_FALLTHROUGH` macro to explicitly state that falling through `case` labels in a `switch` statement is intended * Removes all UNUSED annotations on function parameters. The warning -Wunused-parameter is now disabled globally in `jemalloc_internal_macros.h` for all translation units that include that header. It is never re-enabled since that header cannot be included by users. * locally suppresses some -Wextra diagnostics: * `-Wmissing-field-initializer` is buggy in older Clang and GCC versions, where it does not understanding that, in C, `= {0}` is a common C idiom to initialize a struct to zero * `-Wtype-bounds` is suppressed in a particular situation where a generic macro, used in multiple different places, compares an unsigned integer for smaller than zero, which is always true. * `-Walloc-larger-than-size=` diagnostics warn when an allocation function is called with a size that is too large (out-of-range). These are suppressed in the parts of the tests where `jemalloc` explicitly does this to test that the allocation functions fail properly. * adds a new CI build bot that runs the log unit test on CI. Closes #1196 .
* Rename huge_threshold to experimental, and tweak documentation.Qi Wang2018-06-292-2/+2
|
* Add unit test for opt.huge_threshold.Qi Wang2018-06-291-0/+108
|
* Add ctl and stats for opt.huge_threshold.Qi Wang2018-06-291-0/+1
|
* Implement huge arena: opt.huge_threshold.Qi Wang2018-06-291-0/+3
| | | | | | | | | The feature allows using a dedicated arena for huge allocations. We want the addtional arena to separate huge allocation because: 1) mixing small extents with huge ones causes fragmentation over the long run (this feature reduces VM size significantly); 2) with many arenas, huge extents rarely get reused across threads; and 3) huge allocations happen way less frequently, therefore no concerns for lock contention.
* Hooks: Protect against reentrancy.David Goldblatt2018-05-181-0/+42
| | | | | | | Previously, we made the user deal with this themselves, but that's not good enough; if hooks may allocate, we should test the allocation pathways down hooks. If we're doing that, we might as well actually implement the protection for the user.
* Hooks: Add a hook exhaustion test.David Goldblatt2018-05-181-1/+39
| | | | | When we run out of space in which to store hooks, we should return EAGAIN from the mallctl, but not otherwise misbehave.
* Mallctl: Add experimental.hooks.[install|remove].David Goldblatt2018-05-181-1/+39
|
* Hooks: move the "extra" pointer into the hook_t itself.David Goldblatt2018-05-181-22/+23
| | | | | This simplifies the mallctl call to install a hook, which should only take a single argument.
* Hooks: hook the realloc pathways that move/expand.David Goldblatt2018-05-181-1/+112
|
* Hooks: hook the realloc paths that act as pure malloc/free.David Goldblatt2018-05-181-2/+50
|
* Hooks: hook the pure-expand function.David Goldblatt2018-05-181-1/+31
|
* Hooks: hook the pure-deallocation functions.David Goldblatt2018-05-181-1/+49
|
* Hooks: hook the pure-allocation functions.David Goldblatt2018-05-181-2/+122
|
* Add "hook" module.David Goldblatt2018-05-181-0/+180
| | | | | | | | The hook module allows a low-reader-overhead way of finding hooks to invoke and calling them. For now, none of the allocation pathways are tied into the hooks; this will come later.
* Add the Seq module, a simple seqlock implementation.David Goldblatt2018-05-181-0/+95
| | | | | This allows fast reader-writer concurrency in cases where writers are rare. The immediate use case is for the hooking implementaiton.
* Rename hooks module to test_hooks.David Goldblatt2018-05-181-3/+3
| | | | | | "Hooks" is really the best name for the module that will contain the publicly exposed hooks. So lets rename the current "hooks" module (that hook external dependencies, for reentrancy testing) to "test_hooks".
* TSD: Add the ability to enter a global slow path.David Goldblatt2018-05-181-1/+129
| | | | | This gives any thread the ability to send other threads down slow paths the next time they fetch tsd.
* TSD: Make all state access happen through a function.David Goldblatt2018-05-181-2/+2
| | | | | Shortly, tsd state will be atomic and have some complicated enough logic down the state-setting path that we should be aware of it.
* Fix the max_background_thread test.Qi Wang2018-05-151-25/+27
| | | | | We may set number of background threads separately, e.g. through --with-malloc-conf, so avoid assuming the default number in the test.
* Fix background thread index issues with max_background_threads.Qi Wang2018-05-151-2/+2
|
* Mallctl: Add arenas.lookupLatchesar Ionkov2018-05-011-0/+17
| | | | | Implement a new mallctl operation that allows looking up the arena a region of memory belongs to.
* background_thread: add max thread count configDave Watson2018-04-101-2/+48
| | | | | 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.
* Fix const qualifier warnings.Qi Wang2018-04-091-1/+1
|
* Fix type warning on Windows.Qi Wang2018-04-091-1/+1
| | | | Add cast since read / write has unsigned return type on windows.
* Fix a background_thread shutdown issue.Qi Wang2018-04-021-0/+3
| | | | | 1) make sure background thread 0 is always created; and 2) fix synchronization between thread 0 and the control thread.
* Emitter: Add support for row-based output in table mode.David Goldblatt2018-03-091-1/+63
| | | | This is needed for things like mutex stats in table mode.