http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50511
Bug #: 50511 Summary: gcc lto streamer in fragments memory badly Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: andi-...@firstfloor.org I ran into a problem while testing LTO on a quite large project with a lot of object files: the lto streamer fragmented the memory map badly by constantly mapping and unmapping the input files with mmap. I ended up with a memory map with lots of 2 page holes between mappings. Eventually it bumped into the default 64k max number of mappings limit on Linux and errored out because mmap failed. Workaround was to increase this limit (sysctl -w vm.max_map_count = 200000) However gcc should be more efficient in its mappings. I think the problem is the one off cache in lto_file_read() being too dumb. Looking into a fix.