summaryrefslogtreecommitdiff
path: root/lib/resource.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-02-22 14:45:20 +0100
committerMaria Matejka <mq@ucw.cz>2023-02-22 14:54:09 +0100
commit6c058ae40cf33d6d36c0159d0c40c9925c8e60d8 (patch)
tree282df74afb8e92ec083a3385b09c6848f247b09a /lib/resource.h
parent913ec57f27b06845e3698e8ea08821d39b9575cf (diff)
Linpool flush drops all the allocated pages but one
When a linpool is used to allocate a one-off big load of memory, it makes no sense to keep that amount of memory for future use inside the linpool. Contrary to previous implementations where the memory was directly free()d, we now use the page allocator which has an internal cache which keeps the released pages for us and subsequent allocations simply get these released pages back. And even if the page cleanup routine kicks in inbetween, the pages get only madvise()d, not munmap()ed so performance aspects are negligible. This may fix some memory usage peaks in extreme cases.
Diffstat (limited to 'lib/resource.h')
0 files changed, 0 insertions, 0 deletions