From: ko1@... Date: 2018-08-01T06:53:33+00:00 Subject: [ruby-core:88252] [Ruby trunk Feature#14955] [PATCH] gc.c: use MADV_FREE to release most of the heap page body Issue #14955 has been updated by ko1 (Koichi Sasada). It causes system call and extra overhead so that I'm not sure it is acceptable. On previous proposal I could measure some performance down on fine-grain madvise. https://bugs.ruby-lang.org/issues/12236 I assume that we need to make sequential groups. 16KB (4 pages) group can be enough (but not sure). ---------------------------------------- Feature #14955: [PATCH] gc.c: use MADV_FREE to release most of the heap page body https://bugs.ruby-lang.org/issues/14955#change-73274 * Author: normalperson (Eric Wong) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- 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-------------------------------- 0001-gc.c-use-MADV_FREE-to-release-most-the-heap-page-bod.patch (5.78 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: