diff options
author | John Högberg <[email protected]> | 2018-08-29 16:21:17 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-12-07 12:28:51 +0100 |
commit | 1d549eddbeeccf7d108310466de5f63af04b004c (patch) | |
tree | 6c3623605f7f1b80ec732caac2d4adb1b6bb08d3 /erts/emulator/beam/erl_alloc_util.h | |
parent | 4b9836a2dada60005e01067af04a0e0d9361fcee (diff) | |
download | otp-1d549eddbeeccf7d108310466de5f63af04b004c.tar.gz otp-1d549eddbeeccf7d108310466de5f63af04b004c.tar.bz2 otp-1d549eddbeeccf7d108310466de5f63af04b004c.zip |
Mark free blocks in pooled carriers as unused (MADV_FREE)
This lets the OS reclaim the physical memory associated with these
blocks which reduces the impact of long-lived awkward allocations.
A small allocated block will still keep a huge carrier alive, but
the unused part of the carrier will now be available to the OS.
Co-authored-by: Dmytro Lytovchenko <[email protected]>
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.h')
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h index 9ab8589bf3..ea1afe8f58 100644 --- a/erts/emulator/beam/erl_alloc_util.h +++ b/erts/emulator/beam/erl_alloc_util.h @@ -684,10 +684,12 @@ struct Allctr_t_ { void (*creating_mbc) (Allctr_t *, Carrier_t *); void (*destroying_mbc) (Allctr_t *, Carrier_t *); - /* The three callbacks below are needed to support carrier migration */ + /* The five callbacks below are needed to support carrier migration. */ void (*add_mbc) (Allctr_t *, Carrier_t *); void (*remove_mbc) (Allctr_t *, Carrier_t *); UWord (*largest_fblk_in_mbc) (Allctr_t *, Carrier_t *); + Block_t * (*first_fblk_in_mbc) (Allctr_t *, Carrier_t *); + Block_t * (*next_fblk_in_mbc) (Allctr_t *, Carrier_t *, Block_t *); #if HAVE_ERTS_MSEG void* (*mseg_alloc)(Allctr_t*, Uint *size_p, Uint flags); |