facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.05k stars 539 forks source link

G++ exhausted the memory while compiling Acceptor.cpp #51

Closed guoxiao closed 8 years ago

guoxiao commented 8 years ago

My g++ version is

% g++ --version
g++ (GCC) 6.1.1 20160510 (Red Hat 6.1.1-2)
Copyright (C) 2016 Free Software Foundation, Inc.

I don't know if it's a bug of g++ or it's a problem caused by the structure of Acceptor.cpp.

djwatson commented 8 years ago

How much memory did it use?

guoxiao commented 8 years ago

@djwatson It will use up all my 16GB memory and get killed by the kernel while compiling this file.

djwatson commented 8 years ago

I see ~1.5G taken for compilation, although that's on 4.8 or 5. I'm guessing this is a gcc bug, but I'll leave this open until we know for sure.

djwatson commented 8 years ago

Also compiles fine with clang 3.9.0

snarkmaster commented 8 years ago

I have frequently built wangle and fbthrift and folly with GCC 4.8 on a 1.5GB VM. Only fbthrift gets close to running out of memory. I would guess that the new GCC is leaky or has an overly expensive optimization pass.

To measure memory usage of a process, you can try /usr/bin/time FAILING COMMAND. Look for maxresident.

guoxiao commented 8 years ago

The gcc-c++ package from Fedora Rawhide has fixed the problem.

% g++ --version g++ (GCC) 6.1.1 20160721 (Red Hat 6.1.1-4)