From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1217 invoked by alias); 5 Oct 2013 09:29:58 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1156 invoked by uid 48); 5 Oct 2013 09:29:55 -0000 From: "ofv at wanadoo dot es" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56746] [4.8 regression] increased memory usage when compiling C++ Date: Sat, 05 Oct 2013 09:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: ofv at wanadoo dot es X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg00273.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746 ofv at wanadoo dot es changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ofv at wanadoo dot es --- Comment #13 from ofv at wanadoo dot es --- My case is similar to the one described by Mathias Gaunard, but with a difference of 3x memory usage when -ftrack-macro-expansion=0 is not added to the command line. I use Boost Preprocessor plus a number of macros to define and instantiate lots of templates. That's the case that requires 3x more memory (low estimate) with some TUs requiring way more than 1GB to compile (on a 32 bit machine, which means that parallel builds usually ends with massive swapping and the compile jobs killed due to memory starvation.) I have a version of the same code base that uses variadic templates instead of Boost Preprocessor, although the macros for instantiating the templates are still there. That requires about 1.5x more memory.