Skip to content

Commit df900db

Browse files
committed
Merge branch 'dev'
2 parents 91010a9 + 3a34261 commit df900db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6236
-1590
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ test/include/test/jemalloc_test_defs.h
7373
/test/unit/*.out
7474

7575
/VERSION
76+
77+
*.pdb
78+
*.sdf
79+
*.opendb
80+
*.opensdf
81+
*.cachefile
82+
*.suo
83+
*.user
84+
*.sln.docstates
85+
*.tmp
86+
/msvc/Win32/
87+
/msvc/x64/
88+
/msvc/projects/*/*/Debug*/
89+
/msvc/projects/*/*/Release*/
90+
/msvc/projects/*/*/Win32/
91+
/msvc/projects/*/*/x64/

ChangeLog

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,79 @@ brevity. Much more detail can be found in the git revision history:
44

55
https://github.com/jemalloc/jemalloc
66

7+
* 4.1.0 (February 28, 2016)
8+
9+
This release is primarily about optimizations, but it also incorporates a lot
10+
of portability-motivated refactoring and enhancements. Many people worked on
11+
this release, to an extent that even with the omission here of minor changes
12+
(see git revision history), and of the people who reported and diagnosed
13+
issues, so much of the work was contributed that starting with this release,
14+
changes are annotated with author credits to help reflect the collaborative
15+
effort involved.
16+
17+
New features:
18+
- Implement decay-based unused dirty page purging, a major optimization with
19+
mallctl API impact. This is an alternative to the existing ratio-based
20+
unused dirty page purging, and is intended to eventually become the sole
21+
purging mechanism. New mallctls:
22+
+ opt.purge
23+
+ opt.decay_time
24+
+ arena.<i>.decay
25+
+ arena.<i>.decay_time
26+
+ arenas.decay_time
27+
+ stats.arenas.<i>.decay_time
28+
(@jasone, @cevans87)
29+
- Add --with-malloc-conf, which makes it possible to embed a default
30+
options string during configuration. This was motivated by the desire to
31+
specify --with-malloc-conf=purge:decay , since the default must remain
32+
purge:ratio until the 5.0.0 release. (@jasone)
33+
- Add MS Visual Studio 2015 support. (@rustyx, @yuslepukhin)
34+
- Make *allocx() size class overflow behavior defined. The maximum
35+
size class is now less than PTRDIFF_MAX to protect applications against
36+
numerical overflow, and all allocation functions are guaranteed to indicate
37+
errors rather than potentially crashing if the request size exceeds the
38+
maximum size class. (@jasone)
39+
- jeprof:
40+
+ Add raw heap profile support. (@jasone)
41+
+ Add --retain and --exclude for backtrace symbol filtering. (@jasone)
42+
43+
Optimizations:
44+
- Optimize the fast path to combine various bootstrapping and configuration
45+
checks and execute more streamlined code in the common case. (@interwq)
46+
- Use linear scan for small bitmaps (used for small object tracking). In
47+
addition to speeding up bitmap operations on 64-bit systems, this reduces
48+
allocator metadata overhead by approximately 0.2%. (@djwatson)
49+
- Separate arena_avail trees, which substantially speeds up run tree
50+
operations. (@djwatson)
51+
- Use memoization (boot-time-computed table) for run quantization. Separate
52+
arena_avail trees reduced the importance of this optimization. (@jasone)
53+
- Attempt mmap-based in-place huge reallocation. This can dramatically speed
54+
up incremental huge reallocation. (@jasone)
55+
56+
Incompatible changes:
57+
- Make opt.narenas unsigned rather than size_t. (@jasone)
58+
59+
Bug fixes:
60+
- Fix stats.cactive accounting regression. (@rustyx, @jasone)
61+
- Handle unaligned keys in hash(). This caused problems for some ARM systems.
62+
(@jasone, Christopher Ferris)
63+
- Refactor arenas array. In addition to fixing a fork-related deadlock, this
64+
makes arena lookups faster and simpler. (@jasone)
65+
- Move retained memory allocation out of the default chunk allocation
66+
function, to a location that gets executed even if the application installs
67+
a custom chunk allocation function. This resolves a virtual memory leak.
68+
(@buchgr)
69+
- Fix a potential tsd cleanup leak. (Christopher Ferris, @jasone)
70+
- Fix run quantization. In practice this bug had no impact unless
71+
applications requested memory with alignment exceeding one page.
72+
(@jasone, @djwatson)
73+
- Fix LinuxThreads-specific bootstrapping deadlock. (Cosmin Paraschiv)
74+
- jeprof:
75+
+ Don't discard curl options if timeout is not defined. (@djwatson)
76+
+ Detect failed profile fetches. (@djwatson)
77+
- Fix stats.arenas.<i>.{dss,lg_dirty_mult,decay_time,pactive,pdirty} for
78+
--disable-stats case. (@jasone)
79+
780
* 4.0.4 (October 24, 2015)
881

982
This bugfix release fixes another xallocx() regression. No other regressions

INSTALL

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ any of the following arguments (not a definitive list) to 'configure':
8484
versions of jemalloc can coexist in the same installation directory. For
8585
example, libjemalloc.so.0 becomes libjemalloc<suffix>.so.0.
8686

87+
--with-malloc-conf=<malloc_conf>
88+
Embed <malloc_conf> as a run-time options string that is processed prior to
89+
the malloc_conf global variable, the /etc/malloc.conf symlink, and the
90+
MALLOC_CONF environment variable. For example, to change the default chunk
91+
size to 256 KiB:
92+
93+
--with-malloc-conf=lg_chunk:18
94+
8795
--disable-cc-silence
8896
Disable code that silences non-useful compiler warnings. This is mainly
8997
useful during development when auditing the set of warnings that are being

Makefile.in

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,32 @@ LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix)
7878
# Lists of files.
7979
BINS := $(objroot)bin/jemalloc-config $(objroot)bin/jemalloc.sh $(objroot)bin/jeprof
8080
C_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h
81-
C_SRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c \
82-
$(srcroot)src/atomic.c $(srcroot)src/base.c $(srcroot)src/bitmap.c \
83-
$(srcroot)src/chunk.c $(srcroot)src/chunk_dss.c \
84-
$(srcroot)src/chunk_mmap.c $(srcroot)src/ckh.c $(srcroot)src/ctl.c \
85-
$(srcroot)src/extent.c $(srcroot)src/hash.c $(srcroot)src/huge.c \
86-
$(srcroot)src/mb.c $(srcroot)src/mutex.c $(srcroot)src/pages.c \
87-
$(srcroot)src/prof.c $(srcroot)src/quarantine.c $(srcroot)src/rtree.c \
88-
$(srcroot)src/stats.c $(srcroot)src/tcache.c $(srcroot)src/util.c \
89-
$(srcroot)src/tsd.c
81+
C_SRCS := $(srcroot)src/jemalloc.c \
82+
$(srcroot)src/arena.c \
83+
$(srcroot)src/atomic.c \
84+
$(srcroot)src/base.c \
85+
$(srcroot)src/bitmap.c \
86+
$(srcroot)src/chunk.c \
87+
$(srcroot)src/chunk_dss.c \
88+
$(srcroot)src/chunk_mmap.c \
89+
$(srcroot)src/ckh.c \
90+
$(srcroot)src/ctl.c \
91+
$(srcroot)src/extent.c \
92+
$(srcroot)src/hash.c \
93+
$(srcroot)src/huge.c \
94+
$(srcroot)src/mb.c \
95+
$(srcroot)src/mutex.c \
96+
$(srcroot)src/nstime.c \
97+
$(srcroot)src/pages.c \
98+
$(srcroot)src/prng.c \
99+
$(srcroot)src/prof.c \
100+
$(srcroot)src/quarantine.c \
101+
$(srcroot)src/rtree.c \
102+
$(srcroot)src/stats.c \
103+
$(srcroot)src/tcache.c \
104+
$(srcroot)src/ticker.c \
105+
$(srcroot)src/tsd.c \
106+
$(srcroot)src/util.c
90107
ifeq ($(enable_valgrind), 1)
91108
C_SRCS += $(srcroot)src/valgrind.c
92109
endif
@@ -116,10 +133,11 @@ C_TESTLIB_SRCS := $(srcroot)test/src/btalloc.c $(srcroot)test/src/btalloc_0.c \
116133
$(srcroot)test/src/mtx.c $(srcroot)test/src/mq.c \
117134
$(srcroot)test/src/SFMT.c $(srcroot)test/src/test.c \
118135
$(srcroot)test/src/thd.c $(srcroot)test/src/timer.c
119-
C_UTIL_INTEGRATION_SRCS := $(srcroot)src/util.c
136+
C_UTIL_INTEGRATION_SRCS := $(srcroot)src/nstime.c $(srcroot)src/util.c
120137
TESTS_UNIT := $(srcroot)test/unit/atomic.c \
121138
$(srcroot)test/unit/bitmap.c \
122139
$(srcroot)test/unit/ckh.c \
140+
$(srcroot)test/unit/decay.c \
123141
$(srcroot)test/unit/hash.c \
124142
$(srcroot)test/unit/junk.c \
125143
$(srcroot)test/unit/junk_alloc.c \
@@ -129,6 +147,7 @@ TESTS_UNIT := $(srcroot)test/unit/atomic.c \
129147
$(srcroot)test/unit/math.c \
130148
$(srcroot)test/unit/mq.c \
131149
$(srcroot)test/unit/mtx.c \
150+
$(srcroot)test/unit/prng.c \
132151
$(srcroot)test/unit/prof_accum.c \
133152
$(srcroot)test/unit/prof_active.c \
134153
$(srcroot)test/unit/prof_gdump.c \
@@ -140,9 +159,13 @@ TESTS_UNIT := $(srcroot)test/unit/atomic.c \
140159
$(srcroot)test/unit/quarantine.c \
141160
$(srcroot)test/unit/rb.c \
142161
$(srcroot)test/unit/rtree.c \
162+
$(srcroot)test/unit/run_quantize.c \
143163
$(srcroot)test/unit/SFMT.c \
144164
$(srcroot)test/unit/size_classes.c \
165+
$(srcroot)test/unit/smoothstep.c \
145166
$(srcroot)test/unit/stats.c \
167+
$(srcroot)test/unit/ticker.c \
168+
$(srcroot)test/unit/nstime.c \
146169
$(srcroot)test/unit/tsd.c \
147170
$(srcroot)test/unit/util.c \
148171
$(srcroot)test/unit/zero.c
@@ -349,18 +372,22 @@ stress_dir:
349372
check_dir: check_unit_dir check_integration_dir
350373

351374
check_unit: tests_unit check_unit_dir
352-
$(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%)
375+
$(MALLOC_CONF)="purge:ratio" $(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%)
376+
$(MALLOC_CONF)="purge:decay" $(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%)
353377
check_integration_prof: tests_integration check_integration_dir
354378
ifeq ($(enable_prof), 1)
355379
$(MALLOC_CONF)="prof:true" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
356380
$(MALLOC_CONF)="prof:true,prof_active:false" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
357381
endif
382+
check_integration_decay: tests_integration check_integration_dir
383+
$(MALLOC_CONF)="purge:decay,decay_time:-1" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
384+
$(MALLOC_CONF)="purge:decay,decay_time:0" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
385+
$(MALLOC_CONF)="purge:decay" $(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
358386
check_integration: tests_integration check_integration_dir
359387
$(SHELL) $(objroot)test/test.sh $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
360388
stress: tests_stress stress_dir
361389
$(SHELL) $(objroot)test/test.sh $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%)
362-
check: tests check_dir check_integration_prof
363-
$(SHELL) $(objroot)test/test.sh $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%) $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%)
390+
check: check_unit check_integration check_integration_decay check_integration_prof
364391

365392
ifeq ($(enable_code_coverage), 1)
366393
coverage_unit: check_unit

0 commit comments

Comments
 (0)