This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/50636] GC in large LTO builds cause excessive fragmentation in memory map
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Oct 2011 10:01:32 +0000
- Subject: [Bug other/50636] GC in large LTO builds cause excessive fragmentation in memory map
- Auto-submitted: auto-generated
- References: <bug-50636-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50636
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-07 10:01:32 UTC ---
(In reply to comment #2)
> Perhaps on Linux, at least with recentish kernel, we could change release_pages
> into keeping the pages in the G.free_pages chain, but call madvise
> MADV_DONTNEED on the pages (and remember that we've done that so next
> release_pages won't do it again unless we have since then alloc_page'd it). At
> least on 64-bit hosts where there is plenty of address space. MADV_DONTNEED
> will keep it around unless the kernel needs it for something else (something
> e.g. glibc malloc uses too).
Seems I misremembered what MADV_DONTNEED it, what I described was the proposed
and unfortunately shot down MADV_FREE. MADV_DONTNEED zaps the pages
immediately, so you get new zeroed pages even if it is touched immediately
after the madvise call. Still, even MADV_DONTNEED is useful, it will prevent
the excessive fragmentation.