Project

General

Profile

Actions

Feature #14955

open

[PATCH] gc.c: use MADV_FREE to release most of the heap page body

Added by normalperson (Eric Wong) over 6 years ago. Updated over 6 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:88242]

Description

gc.c: use MADV_FREE to release most the heap page body

On x86 and x86-64 Linux and FreeBSD (at least), we can release
most of the heap page body (12k of nearly 16k). This is better
than causing malloc fragmentation with free(3) on memaligned areas.

cf. https://sourceware.org/bugzilla/show_bug.cgi?id=14581

Note: memory is memory to madvise(2), regardless of whether it
came from brk(2) or mmap(2); so we expect to be able to madvise
any anonymous segments as long as they're page-aligned.
Allocators configured to file-backed mappings will cause
warnings when $VERBOSE is set.


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0