[Bug other/50636] GC in large LTO builds cause excessive fragmentation in memory map

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 6 21:42:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50636

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-06 21:41:41 UTC ---
Right now alloc_page will (usually) allocate in GGC_QUIRE_SIZE * G.pagesize
chunks, but release_pages will munmap individual pages immediately during
collection (well, using one munmap if there are consecutive free pages, but
that is not very likely everything is going to be freed from the whole 1MB
page).
Guess we could do MADV_DONTNEED on the individual pages immediately and if we
have consecutive 1MB region all free, munmap it (or, decide about that based on
how many free pages we have etc.).  I guess doubling GGC_QUIRE_SIZE is
reasonable too.



More information about the Gcc-bugs mailing list