From 711a3d82e524cae4fa2acce8f2e363f0f23a6032 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 17 Oct 2011 14:43:37 +0000 Subject: Use MADV_DONTNEED for freeing in garbage collector Use the Linux MADV_DONTNEED call to unmap free pages in the garbage collector.Then keep the unmapped pages in the free list. This avoid excessive memory fragmentation on large LTO bulds, which can lead to gcc bumping into the Linux vm_max_map limit per process. gcc/: 2011-10-08 Andi Kleen PR other/50636 * config.in, configure: Regenerate. * configure.ac (madvise): Add to AC_CHECK_FUNCS. * ggc-page.c (USING_MADVISE): Add. (page_entry): Add discarded field. (alloc_page): Check for discarded pages. (release_pages): Add USING_MADVISE branch. From-SVN: r180093 --- gcc/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/configure.ac') diff --git a/gcc/configure.ac b/gcc/configure.ac index a7b94e6..357902e 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1027,7 +1027,7 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap setlocale \ - gcc_UNLOCKED_FUNCS) + gcc_UNLOCKED_FUNCS madvise) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, -- cgit v1.1