Alter AllocSet routines so that requests larger than
Tom Lane <tgl@sss.pgh.pa.us>
Alter AllocSet routines so that requests larger than ALLOC_BIGCHUNK_LIMIT are always allocated as separate malloc() blocks, and are free()d immediately upon pfree(). Also, if such a chunk is enlarged with repalloc(), translate the operation into a realloc() so as to minimize memory usage. Of course, these large chunks still get freed automatically if the alloc set is reset. I have set ALLOC_BIGCHUNK_LIMIT at 64K for now, but perhaps another size would be better?
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/mmgr/aset.c | modified | +133 −40 |
| src/include/utils/memutils.h | modified | +38 −29 |