abseil-cpp icon indicating copy to clipboard operation
abseil-cpp copied to clipboard

virtual memory exhausted: Cannot allocate memory while building btree_test.cc.o

Open HustCoderHu opened this issue 2 years ago • 1 comments

Describe the issue

..
..
[ 42%] Built target flags
[ 42%] Building CXX object absl/container/CMakeFiles/absl_btree_test.dir/btree_test.cc.o
virtual memory exhausted: Cannot allocate memory
make[2]: *** [absl/container/CMakeFiles/absl_btree_test.dir/build.make:63: absl/container/CMakeFiles/absl_btree_test.dir/btree_test.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4031: absl/container/CMakeFiles/absl_btree_test.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Steps to reproduce the problem

cmake -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=14 ..
cmake --build . --target all

What version of Abseil are you using?

master branch c9c0fd5185067208e1cc4227d16122571762af39

What operating system and version are you using?

Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster

What compiler and version are you using?

gcc (Debian 8.3.0-6) 8.3.0

What build system are you using?

cmake version 3.13.4

Additional context

system total memory is about 2000MB, no other process consume much memory. While building btree_test.cc.o, in '$top' i saw VIRT & RES of process cc1plus counted up to 1800000 ~ 1900000 gradually, after which i got 'virtual memory exhausted'

HustCoderHu avatar Jul 29 '23 08:07 HustCoderHu

This is a large, template-heavy test. I'm not surprised that it required a lot of memory to link.

derekmauro avatar Jul 31 '23 18:07 derekmauro