1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Generational memory allocator

Add new style of memory allocator, known as Generational
appropriate for use in cases where memory is allocated
and then freed in roughly oldest first order (FIFO).

Use new allocator for logical decoding’s reorderbuffer
to significantly reduce memory usage and improve performance.

Author: Tomas Vondra
Reviewed-by: Simon Riggs
This commit is contained in:
Simon Riggs
2017-11-23 05:45:07 +11:00
parent 3bae43ca4d
commit a4ccc1cef5
8 changed files with 819 additions and 79 deletions

View File

@@ -344,20 +344,7 @@ struct ReorderBuffer
*/
MemoryContext change_context;
MemoryContext txn_context;
/*
* Data structure slab cache.
*
* We allocate/deallocate some structures very frequently, to avoid bigger
* overhead we cache some unused ones here.
*
* The maximum number of cached entries is controlled by const variables
* on top of reorderbuffer.c
*/
/* cached ReorderBufferTupleBufs */
slist_head cached_tuplebufs;
Size nr_cached_tuplebufs;
MemoryContext tup_context;
XLogRecPtr current_restart_decoding_lsn;