xref: /freebsd/contrib/jemalloc/ChangeLog (revision 8ed34ab00dc684db97a9e5ba466fa7142fbfc7d2)
1a4bd5210SJason EvansFollowing are change highlights associated with official releases.  Important
2a4bd5210SJason Evansbug fixes are all mentioned, but internal enhancements are omitted here for
3a4bd5210SJason Evansbrevity (even though they are more fun to write about).  Much more detail can be
4a4bd5210SJason Evansfound in the git revision history:
5a4bd5210SJason Evans
6a4bd5210SJason Evans    http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
7a4bd5210SJason Evans    git://canonware.com/jemalloc.git
8a4bd5210SJason Evans
9a4bd5210SJason Evans* 3.0.0 (XXX not yet released)
10a4bd5210SJason Evans
11a4bd5210SJason Evans  Although this version adds some major new features, the primary focus is on
12a4bd5210SJason Evans  internal code cleanup that facilitates maintainability and portability, most
13a4bd5210SJason Evans  of which is not reflected in the ChangeLog.  This is the first release to
14a4bd5210SJason Evans  incorporate substantial contributions from numerous other developers, and the
15a4bd5210SJason Evans  result is a more broadly useful allocator (see the git revision history for
16a4bd5210SJason Evans  contribution details).  Note that the license has been unified, thanks to
17a4bd5210SJason Evans  Facebook granting a license under the same terms as the other copyright
18a4bd5210SJason Evans  holders (see COPYING).
19a4bd5210SJason Evans
20a4bd5210SJason Evans  New features:
21a4bd5210SJason Evans  - Implement Valgrind support, redzones, and quarantine.
22a4bd5210SJason Evans  - Add support for additional operating systems:
23a4bd5210SJason Evans    + FreeBSD
24a4bd5210SJason Evans    + Mac OS X Lion
25a4bd5210SJason Evans  - Add support for additional architectures:
26a4bd5210SJason Evans    + MIPS
27a4bd5210SJason Evans    + SH4
28a4bd5210SJason Evans    + Tilera
29a4bd5210SJason Evans  - Add support for cross compiling.
30a4bd5210SJason Evans  - Add nallocm(), which rounds a request size up to the nearest size class
31a4bd5210SJason Evans    without actually allocating.
32a4bd5210SJason Evans  - Implement aligned_alloc() (blame C11).
33a4bd5210SJason Evans  - Add the --disable-munmap option, and make it the default on Linux.
34a4bd5210SJason Evans  - Add the --with-mangling option.
35a4bd5210SJason Evans  - Add the --disable-experimental option.
36a4bd5210SJason Evans  - Add the "thread.tcache.enabled" mallctl.
37*8ed34ab0SJason Evans  - Add the "opt.prof_final" mallctl.
38*8ed34ab0SJason Evans  - Update pprof (from gperftools 2.0).
39a4bd5210SJason Evans
40a4bd5210SJason Evans  Incompatible changes:
41a4bd5210SJason Evans  - Enable stats by default.
42a4bd5210SJason Evans  - Enable fill by default.
43a4bd5210SJason Evans  - Disable lazy locking by default.
44a4bd5210SJason Evans  - Rename the "tcache.flush" mallctl to "thread.tcache.flush".
45a4bd5210SJason Evans  - Rename the "arenas.pagesize" mallctl to "arenas.page".
46*8ed34ab0SJason Evans  - Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB).
47*8ed34ab0SJason Evans  - Change the "opt.prof_accum" default from true to false.
48a4bd5210SJason Evans
49a4bd5210SJason Evans  Removed features:
50a4bd5210SJason Evans  - Remove the swap feature, including the "config.swap", "swap.avail",
51a4bd5210SJason Evans    "swap.prezeroed", "swap.nfds", and "swap.fds" mallctls.
52a4bd5210SJason Evans  - Remove highruns statistics, including the
53a4bd5210SJason Evans    "stats.arenas.<i>.bins.<j>.highruns" and
54a4bd5210SJason Evans    "stats.arenas.<i>.lruns.<j>.highruns" mallctls.
55a4bd5210SJason Evans  - As part of small size class refactoring, remove the "opt.lg_[qc]space_max",
56a4bd5210SJason Evans    "arenas.cacheline", "arenas.subpage", "arenas.[tqcs]space_{min,max}", and
57a4bd5210SJason Evans    "arenas.[tqcs]bins" mallctls.
58a4bd5210SJason Evans  - Remove the "arenas.chunksize" mallctl.
59a4bd5210SJason Evans  - Remove the "opt.lg_prof_tcmax" option.
60a4bd5210SJason Evans  - Remove the "opt.lg_prof_bt_max" option.
61a4bd5210SJason Evans  - Remove the "opt.lg_tcache_gc_sweep" option.
62a4bd5210SJason Evans  - Remove the --disable-tiny option, including the "config.tiny" mallctl.
63a4bd5210SJason Evans  - Remove the --enable-dynamic-page-shift configure option.
64a4bd5210SJason Evans  - Remove the --enable-sysv configure option.
65a4bd5210SJason Evans
66a4bd5210SJason Evans  Bug fixes:
67a4bd5210SJason Evans  - Fix fork-related bugs that could cause deadlock in children between fork
68a4bd5210SJason Evans    and exec.
69a4bd5210SJason Evans  - Fix a statistics-related bug in the "thread.arena" mallctl that could cause
70a4bd5210SJason Evans    invalid statistics and crashes.
71a4bd5210SJason Evans  - Work around TLS dallocation via free() on Linux.  This bug could cause
72a4bd5210SJason Evans    write-after-free memory corruption.
73a4bd5210SJason Evans  - Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter.
74a4bd5210SJason Evans  - Fix realloc(p, 0) to act like free(p).
75a4bd5210SJason Evans  - Do not enforce minimum alignment in memalign().
76a4bd5210SJason Evans  - Check for NULL pointer in malloc_usable_size().
77a4bd5210SJason Evans  - Fix bin->runcur management to fix a layout policy bug.  This bug did not
78a4bd5210SJason Evans    affect correctness.
79a4bd5210SJason Evans  - Fix a bug in choose_arena_hard() that potentially caused more arenas to be
80a4bd5210SJason Evans    initialized than necessary.
81a4bd5210SJason Evans  - Add missing "opt.lg_tcache_max" mallctl implementation.
82a4bd5210SJason Evans  - Use glibc allocator hooks to make mixed allocator usage less likely.
83a4bd5210SJason Evans  - Fix build issues for --disable-tcache.
84*8ed34ab0SJason Evans  - Don't mangle pthread_create() when --with-private-namespace is specified.
85a4bd5210SJason Evans
86a4bd5210SJason Evans* 2.2.5 (November 14, 2011)
87a4bd5210SJason Evans
88a4bd5210SJason Evans  Bug fixes:
89a4bd5210SJason Evans  - Fix huge_ralloc() race when using mremap(2).  This is a serious bug that
90a4bd5210SJason Evans    could cause memory corruption and/or crashes.
91a4bd5210SJason Evans  - Fix huge_ralloc() to maintain chunk statistics.
92a4bd5210SJason Evans  - Fix malloc_stats_print(..., "a") output.
93a4bd5210SJason Evans
94a4bd5210SJason Evans* 2.2.4 (November 5, 2011)
95a4bd5210SJason Evans
96a4bd5210SJason Evans  Bug fixes:
97a4bd5210SJason Evans  - Initialize arenas_tsd before using it.  This bug existed for 2.2.[0-3], as
98a4bd5210SJason Evans    well as for --disable-tls builds in earlier releases.
99a4bd5210SJason Evans  - Do not assume a 4 KiB page size in test/rallocm.c.
100a4bd5210SJason Evans
101a4bd5210SJason Evans* 2.2.3 (August 31, 2011)
102a4bd5210SJason Evans
103a4bd5210SJason Evans  This version fixes numerous bugs related to heap profiling.
104a4bd5210SJason Evans
105a4bd5210SJason Evans  Bug fixes:
106a4bd5210SJason Evans  - Fix a prof-related race condition.  This bug could cause memory corruption,
107a4bd5210SJason Evans    but only occurred in non-default configurations (prof_accum:false).
108a4bd5210SJason Evans  - Fix off-by-one backtracing issues (make sure that prof_alloc_prep() is
109a4bd5210SJason Evans    excluded from backtraces).
110a4bd5210SJason Evans  - Fix a prof-related bug in realloc() (only triggered by OOM errors).
111a4bd5210SJason Evans  - Fix prof-related bugs in allocm() and rallocm().
112a4bd5210SJason Evans  - Fix prof_tdata_cleanup() for --disable-tls builds.
113a4bd5210SJason Evans  - Fix a relative include path, to fix objdir builds.
114a4bd5210SJason Evans
115a4bd5210SJason Evans* 2.2.2 (July 30, 2011)
116a4bd5210SJason Evans
117a4bd5210SJason Evans  Bug fixes:
118a4bd5210SJason Evans  - Fix a build error for --disable-tcache.
119a4bd5210SJason Evans  - Fix assertions in arena_purge() (for real this time).
120a4bd5210SJason Evans  - Add the --with-private-namespace option.  This is a workaround for symbol
121a4bd5210SJason Evans    conflicts that can inadvertently arise when using static libraries.
122a4bd5210SJason Evans
123a4bd5210SJason Evans* 2.2.1 (March 30, 2011)
124a4bd5210SJason Evans
125a4bd5210SJason Evans  Bug fixes:
126a4bd5210SJason Evans  - Implement atomic operations for x86/x64.  This fixes compilation failures
127a4bd5210SJason Evans    for versions of gcc that are still in wide use.
128a4bd5210SJason Evans  - Fix an assertion in arena_purge().
129a4bd5210SJason Evans
130a4bd5210SJason Evans* 2.2.0 (March 22, 2011)
131a4bd5210SJason Evans
132a4bd5210SJason Evans  This version incorporates several improvements to algorithms and data
133a4bd5210SJason Evans  structures that tend to reduce fragmentation and increase speed.
134a4bd5210SJason Evans
135a4bd5210SJason Evans  New features:
136a4bd5210SJason Evans  - Add the "stats.cactive" mallctl.
137a4bd5210SJason Evans  - Update pprof (from google-perftools 1.7).
138a4bd5210SJason Evans  - Improve backtracing-related configuration logic, and add the
139a4bd5210SJason Evans    --disable-prof-libgcc option.
140a4bd5210SJason Evans
141a4bd5210SJason Evans  Bug fixes:
142a4bd5210SJason Evans  - Change default symbol visibility from "internal", to "hidden", which
143a4bd5210SJason Evans    decreases the overhead of library-internal function calls.
144a4bd5210SJason Evans  - Fix symbol visibility so that it is also set on OS X.
145a4bd5210SJason Evans  - Fix a build dependency regression caused by the introduction of the .pic.o
146a4bd5210SJason Evans    suffix for PIC object files.
147a4bd5210SJason Evans  - Add missing checks for mutex initialization failures.
148a4bd5210SJason Evans  - Don't use libgcc-based backtracing except on x64, where it is known to work.
149a4bd5210SJason Evans  - Fix deadlocks on OS X that were due to memory allocation in
150a4bd5210SJason Evans    pthread_mutex_lock().
151a4bd5210SJason Evans  - Heap profiling-specific fixes:
152a4bd5210SJason Evans    + Fix memory corruption due to integer overflow in small region index
153a4bd5210SJason Evans      computation, when using a small enough sample interval that profiling
154a4bd5210SJason Evans      context pointers are stored in small run headers.
155a4bd5210SJason Evans    + Fix a bootstrap ordering bug that only occurred with TLS disabled.
156a4bd5210SJason Evans    + Fix a rallocm() rsize bug.
157a4bd5210SJason Evans    + Fix error detection bugs for aligned memory allocation.
158a4bd5210SJason Evans
159a4bd5210SJason Evans* 2.1.3 (March 14, 2011)
160a4bd5210SJason Evans
161a4bd5210SJason Evans  Bug fixes:
162a4bd5210SJason Evans  - Fix a cpp logic regression (due to the "thread.{de,}allocatedp" mallctl fix
163a4bd5210SJason Evans    for OS X in 2.1.2).
164a4bd5210SJason Evans  - Fix a "thread.arena" mallctl bug.
165a4bd5210SJason Evans  - Fix a thread cache stats merging bug.
166a4bd5210SJason Evans
167a4bd5210SJason Evans* 2.1.2 (March 2, 2011)
168a4bd5210SJason Evans
169a4bd5210SJason Evans  Bug fixes:
170a4bd5210SJason Evans  - Fix "thread.{de,}allocatedp" mallctl for OS X.
171a4bd5210SJason Evans  - Add missing jemalloc.a to build system.
172a4bd5210SJason Evans
173a4bd5210SJason Evans* 2.1.1 (January 31, 2011)
174a4bd5210SJason Evans
175a4bd5210SJason Evans  Bug fixes:
176a4bd5210SJason Evans  - Fix aligned huge reallocation (affected allocm()).
177a4bd5210SJason Evans  - Fix the ALLOCM_LG_ALIGN macro definition.
178a4bd5210SJason Evans  - Fix a heap dumping deadlock.
179a4bd5210SJason Evans  - Fix a "thread.arena" mallctl bug.
180a4bd5210SJason Evans
181a4bd5210SJason Evans* 2.1.0 (December 3, 2010)
182a4bd5210SJason Evans
183a4bd5210SJason Evans  This version incorporates some optimizations that can't quite be considered
184a4bd5210SJason Evans  bug fixes.
185a4bd5210SJason Evans
186a4bd5210SJason Evans  New features:
187a4bd5210SJason Evans  - Use Linux's mremap(2) for huge object reallocation when possible.
188a4bd5210SJason Evans  - Avoid locking in mallctl*() when possible.
189a4bd5210SJason Evans  - Add the "thread.[de]allocatedp" mallctl's.
190a4bd5210SJason Evans  - Convert the manual page source from roff to DocBook, and generate both roff
191a4bd5210SJason Evans    and HTML manuals.
192a4bd5210SJason Evans
193a4bd5210SJason Evans  Bug fixes:
194a4bd5210SJason Evans  - Fix a crash due to incorrect bootstrap ordering.  This only impacted
195a4bd5210SJason Evans    --enable-debug --enable-dss configurations.
196a4bd5210SJason Evans  - Fix a minor statistics bug for mallctl("swap.avail", ...).
197a4bd5210SJason Evans
198a4bd5210SJason Evans* 2.0.1 (October 29, 2010)
199a4bd5210SJason Evans
200a4bd5210SJason Evans  Bug fixes:
201a4bd5210SJason Evans  - Fix a race condition in heap profiling that could cause undefined behavior
202a4bd5210SJason Evans    if "opt.prof_accum" were disabled.
203a4bd5210SJason Evans  - Add missing mutex unlocks for some OOM error paths in the heap profiling
204a4bd5210SJason Evans    code.
205a4bd5210SJason Evans  - Fix a compilation error for non-C99 builds.
206a4bd5210SJason Evans
207a4bd5210SJason Evans* 2.0.0 (October 24, 2010)
208a4bd5210SJason Evans
209a4bd5210SJason Evans  This version focuses on the experimental *allocm() API, and on improved
210a4bd5210SJason Evans  run-time configuration/introspection.  Nonetheless, numerous performance
211a4bd5210SJason Evans  improvements are also included.
212a4bd5210SJason Evans
213a4bd5210SJason Evans  New features:
214a4bd5210SJason Evans  - Implement the experimental {,r,s,d}allocm() API, which provides a superset
215a4bd5210SJason Evans    of the functionality available via malloc(), calloc(), posix_memalign(),
216a4bd5210SJason Evans    realloc(), malloc_usable_size(), and free().  These functions can be used to
217a4bd5210SJason Evans    allocate/reallocate aligned zeroed memory, ask for optional extra memory
218a4bd5210SJason Evans    during reallocation, prevent object movement during reallocation, etc.
219a4bd5210SJason Evans  - Replace JEMALLOC_OPTIONS/JEMALLOC_PROF_PREFIX with MALLOC_CONF, which is
220a4bd5210SJason Evans    more human-readable, and more flexible.  For example:
221a4bd5210SJason Evans      JEMALLOC_OPTIONS=AJP
222a4bd5210SJason Evans    is now:
223a4bd5210SJason Evans      MALLOC_CONF=abort:true,fill:true,stats_print:true
224a4bd5210SJason Evans  - Port to Apple OS X.  Sponsored by Mozilla.
225a4bd5210SJason Evans  - Make it possible for the application to control thread-->arena mappings via
226a4bd5210SJason Evans    the "thread.arena" mallctl.
227a4bd5210SJason Evans  - Add compile-time support for all TLS-related functionality via pthreads TSD.
228a4bd5210SJason Evans    This is mainly of interest for OS X, which does not support TLS, but has a
229a4bd5210SJason Evans    TSD implementation with similar performance.
230a4bd5210SJason Evans  - Override memalign() and valloc() if they are provided by the system.
231a4bd5210SJason Evans  - Add the "arenas.purge" mallctl, which can be used to synchronously purge all
232a4bd5210SJason Evans    dirty unused pages.
233a4bd5210SJason Evans  - Make cumulative heap profiling data optional, so that it is possible to
234a4bd5210SJason Evans    limit the amount of memory consumed by heap profiling data structures.
235a4bd5210SJason Evans  - Add per thread allocation counters that can be accessed via the
236a4bd5210SJason Evans    "thread.allocated" and "thread.deallocated" mallctls.
237a4bd5210SJason Evans
238a4bd5210SJason Evans  Incompatible changes:
239a4bd5210SJason Evans  - Remove JEMALLOC_OPTIONS and malloc_options (see MALLOC_CONF above).
240a4bd5210SJason Evans  - Increase default backtrace depth from 4 to 128 for heap profiling.
241a4bd5210SJason Evans  - Disable interval-based profile dumps by default.
242a4bd5210SJason Evans
243a4bd5210SJason Evans  Bug fixes:
244a4bd5210SJason Evans  - Remove bad assertions in fork handler functions.  These assertions could
245a4bd5210SJason Evans    cause aborts for some combinations of configure settings.
246a4bd5210SJason Evans  - Fix strerror_r() usage to deal with non-standard semantics in GNU libc.
247a4bd5210SJason Evans  - Fix leak context reporting.  This bug tended to cause the number of contexts
248a4bd5210SJason Evans    to be underreported (though the reported number of objects and bytes were
249a4bd5210SJason Evans    correct).
250a4bd5210SJason Evans  - Fix a realloc() bug for large in-place growing reallocation.  This bug could
251a4bd5210SJason Evans    cause memory corruption, but it was hard to trigger.
252a4bd5210SJason Evans  - Fix an allocation bug for small allocations that could be triggered if
253a4bd5210SJason Evans    multiple threads raced to create a new run of backing pages.
254a4bd5210SJason Evans  - Enhance the heap profiler to trigger samples based on usable size, rather
255a4bd5210SJason Evans    than request size.
256a4bd5210SJason Evans  - Fix a heap profiling bug due to sometimes losing track of requested object
257a4bd5210SJason Evans    size for sampled objects.
258a4bd5210SJason Evans
259a4bd5210SJason Evans* 1.0.3 (August 12, 2010)
260a4bd5210SJason Evans
261a4bd5210SJason Evans  Bug fixes:
262a4bd5210SJason Evans  - Fix the libunwind-based implementation of stack backtracing (used for heap
263a4bd5210SJason Evans    profiling).  This bug could cause zero-length backtraces to be reported.
264a4bd5210SJason Evans  - Add a missing mutex unlock in library initialization code.  If multiple
265a4bd5210SJason Evans    threads raced to initialize malloc, some of them could end up permanently
266a4bd5210SJason Evans    blocked.
267a4bd5210SJason Evans
268a4bd5210SJason Evans* 1.0.2 (May 11, 2010)
269a4bd5210SJason Evans
270a4bd5210SJason Evans  Bug fixes:
271a4bd5210SJason Evans  - Fix junk filling of large objects, which could cause memory corruption.
272a4bd5210SJason Evans  - Add MAP_NORESERVE support for chunk mapping, because otherwise virtual
273a4bd5210SJason Evans    memory limits could cause swap file configuration to fail.  Contributed by
274a4bd5210SJason Evans    Jordan DeLong.
275a4bd5210SJason Evans
276a4bd5210SJason Evans* 1.0.1 (April 14, 2010)
277a4bd5210SJason Evans
278a4bd5210SJason Evans  Bug fixes:
279a4bd5210SJason Evans  - Fix compilation when --enable-fill is specified.
280a4bd5210SJason Evans  - Fix threads-related profiling bugs that affected accuracy and caused memory
281a4bd5210SJason Evans    to be leaked during thread exit.
282a4bd5210SJason Evans  - Fix dirty page purging race conditions that could cause crashes.
283a4bd5210SJason Evans  - Fix crash in tcache flushing code during thread destruction.
284a4bd5210SJason Evans
285a4bd5210SJason Evans* 1.0.0 (April 11, 2010)
286a4bd5210SJason Evans
287a4bd5210SJason Evans  This release focuses on speed and run-time introspection.  Numerous
288a4bd5210SJason Evans  algorithmic improvements make this release substantially faster than its
289a4bd5210SJason Evans  predecessors.
290a4bd5210SJason Evans
291a4bd5210SJason Evans  New features:
292a4bd5210SJason Evans  - Implement autoconf-based configuration system.
293a4bd5210SJason Evans  - Add mallctl*(), for the purposes of introspection and run-time
294a4bd5210SJason Evans    configuration.
295a4bd5210SJason Evans  - Make it possible for the application to manually flush a thread's cache, via
296a4bd5210SJason Evans    the "tcache.flush" mallctl.
297a4bd5210SJason Evans  - Base maximum dirty page count on proportion of active memory.
298a4bd5210SJason Evans  - Compute various addtional run-time statistics, including per size class
299a4bd5210SJason Evans    statistics for large objects.
300a4bd5210SJason Evans  - Expose malloc_stats_print(), which can be called repeatedly by the
301a4bd5210SJason Evans    application.
302a4bd5210SJason Evans  - Simplify the malloc_message() signature to only take one string argument,
303a4bd5210SJason Evans    and incorporate an opaque data pointer argument for use by the application
304a4bd5210SJason Evans    in combination with malloc_stats_print().
305a4bd5210SJason Evans  - Add support for allocation backed by one or more swap files, and allow the
306a4bd5210SJason Evans    application to disable over-commit if swap files are in use.
307a4bd5210SJason Evans  - Implement allocation profiling and leak checking.
308a4bd5210SJason Evans
309a4bd5210SJason Evans  Removed features:
310a4bd5210SJason Evans  - Remove the dynamic arena rebalancing code, since thread-specific caching
311a4bd5210SJason Evans    reduces its utility.
312a4bd5210SJason Evans
313a4bd5210SJason Evans  Bug fixes:
314a4bd5210SJason Evans  - Modify chunk allocation to work when address space layout randomization
315a4bd5210SJason Evans    (ASLR) is in use.
316a4bd5210SJason Evans  - Fix thread cleanup bugs related to TLS destruction.
317a4bd5210SJason Evans  - Handle 0-size allocation requests in posix_memalign().
318a4bd5210SJason Evans  - Fix a chunk leak.  The leaked chunks were never touched, so this impacted
319a4bd5210SJason Evans    virtual memory usage, but not physical memory usage.
320a4bd5210SJason Evans
321a4bd5210SJason Evans* linux_2008082[78]a (August 27/28, 2008)
322a4bd5210SJason Evans
323a4bd5210SJason Evans  These snapshot releases are the simple result of incorporating Linux-specific
324a4bd5210SJason Evans  support into the FreeBSD malloc sources.
325a4bd5210SJason Evans
326a4bd5210SJason Evans--------------------------------------------------------------------------------
327a4bd5210SJason Evansvim:filetype=text:textwidth=80
328