From 1dfaae304dfcc4f249c62b5ab7ff3bd4acef0d50 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sun, 22 May 2011 01:26:06 +0200 Subject: Use separate memory carriers for small blocks --- erts/doc/src/erts_alloc.xml | 52 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 9 deletions(-) (limited to 'erts/doc/src/erts_alloc.xml') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 51a4a2bca0..452e5d990e 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -78,14 +78,20 @@ segments are allocated, cached segments are used if possible instead of creating new segments. This in order to reduce the number of system calls made. + sbmbc_alloc + Allocator used by other allocators for allocation of carriers + where only small blocks are placed. Currently this allocator is + disabled by default.

sys_alloc and fix_alloc are always enabled and cannot be disabled. mseg_alloc is always enabled if it is available and an allocator that uses it is enabled. All other allocators can be enabled or disabled. By default all allocators are enabled. - When an allocator is disabled, sys_alloc - is used instead of the disabled allocator.

+ When an allocator is disabled, sys_alloc is used instead of + the disabled allocator. sbmbc_alloc is an exception. If + sbmbc_alloc is disabled, other allocators will not handle + small blocks in separate carriers.

The main idea with the erts_alloc library is to separate memory blocks that are used differently into different memory areas, and by this achieving less memory fragmentation. By @@ -103,15 +109,20 @@ following does not apply to them.

An allocator manages multiple areas, called carriers, in which memory blocks are placed. A carrier is either placed in a - separate memory segment (allocated via mseg_alloc) or in - the heap segment (allocated via sys_alloc). Multiblock + separate memory segment (allocated via mseg_alloc), in + the heap segment (allocated via sys_alloc), or inside + another carrier (in case it is a carrier created by + sbmbc_alloc). Multiblock carriers are used for storage of several blocks. Singleblock carriers are used for storage of one block. Blocks that are larger than the value of the singleblock carrier threshold (sbct) parameter are placed - in singleblock carriers. Blocks smaller than the value of the - sbct parameter are placed in multiblock - carriers. Normally an allocator creates a "main multiblock + in singleblock carriers. Blocks that are smaller than the value + of the sbct parameter are placed in multiblock + carriers. Blocks that are smaller than the small block multiblock + carrier threshold (sbmbct) + will be placed in multiblock carriers only used for small blocks. + Normally an allocator creates a "main multiblock carrier". Main multiblock carriers are never deallocated. The size of the main multiblock carrier is determined by the value of the mmbcs parameter.

@@ -133,8 +144,11 @@ sbct parameter should be larger than the value of the lmbcs parameter, the allocator may have to create multiblock carriers that are larger than the value of the - lmbcs parameter, though. Singleblock carriers allocated - via mseg_alloc are sized to whole pages.

+ lmbcs parameter, though. The size of multiblock carriers + for small blocks is determined by the small block multiblock + carrier size (sbmbcs). + Singleblock carriers allocated via mseg_alloc are sized + to whole pages.

Sizes of carriers allocated via sys_alloc are decided based on the value of the sys_alloc carrier size (ycs) parameter. The size of @@ -194,6 +208,11 @@ +

+ Currently only allocators using the best fit and the address order + best fit strategies are able to use "small block multi block carriers". +

+
System Flags Effecting erts_alloc @@ -215,6 +234,7 @@ the currently present allocators:

B: binary_alloc + C: sbmbc_alloc D: std_alloc E: ets_alloc F: fix_alloc @@ -395,6 +415,20 @@ threshold will be placed in singleblock carriers. Blocks smaller than this threshold will be placed in multiblock carriers. + sbmbcs ]]> + + Small block multiblock carrier size (in bytes). Memory blocks smaller + than the small block multiblock carrier threshold + (sbmbct) will be placed in + multiblock carriers used for small blocks only. This parameter + determines the size of such carriers. + + sbmbct ]]> + + Small block multiblock carrier threshold (in bytes). Memory blocks + smaller than this threshold will be placed in multiblock carriers + used for small blocks only. + smbcs ]]> Smallest (mseg_alloc) multiblock carrier size (in -- cgit v1.2.3