Re: virtual memory exhausted: Cannot allocate memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2022 at 8:30 AM Florian Weimer <fweimer@xxxxxxxxxx> wrote:
>
> * Mathieu Malaterre via Gcc-help:
>
> > I am having a hard time understanding which flags to change in case of
> > `virtual memory exhausted: Cannot allocate memory`. I can compile
> > openvdb on all Debian supported arches but mipsel. I tried tweaking
> > the debug level as well as the optimization level without luck so far.
> >
> > Latest attempt is:
> >
> > g++-12 [...] -g0 -O0 --param ggc-min-expand=0 --param
> > ggc-min-heapsize=131072 [...]
> >
> > What should I try next ?
>
> It could be a compiler bug.  GCC might try to allocate infinite amounts
> or just way too much memory.
>
> Perhaps you can build with -save-temps, capture the preprocessed .i
> file, and then try to reproduce the issue with a cross-compiler using
> that .i file?

If I understand correctly, the issue is really memory pressure on
mipsel build machine. Steps:

[...]
malat@eller ~/openvdb/obj-mipsel-linux-gnu/openvdb_ax/openvdb_ax
 % time /usr/bin/c++  -save-temps -DBOOST_ALL_NO_LIB
-DBOOST_IOSTREAMS_DYN_LINK -DOPENVDB_AX_DLL -DOPENVDB_AX_PRIVATE
-DOPENVDB_AX_REGENERATE_GRAMMAR -DOPENVDB_DLL
-DOPENVDB_USE_DELAYED_LOADING -DOPENVDB_USE_LOG4CPLUS -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-Dopenvdb_ax_shared_EXPORTS
-I/home/malat/openvdb/openvdb_ax/openvdb_ax/..
-I/home/malat/openvdb/openvdb_ax/openvdb_ax/../../openvdb_cmd/vdb_ax
-I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb_ax/openvdb_ax/openvdb_ax/grammar
-I/home/malat/openvdb/openvdb/openvdb/..
-I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb/openvdb
-I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb/openvdb/openvdb
-isystem /usr/lib/llvm-14/include -isystem /usr/include/Imath -g0 -O0
-ffile-prefix-map=/home/malat/openvdb=. -fstack-protector-strong
-Wformat -Werror=format-security --param ggc-min-expand=0 --param
ggc-min-heapsize=131072 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
-std=c++17 -MD -MT
openvdb_ax/openvdb_ax/CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o
-MF CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o.d
-o CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o -c
/home/malat/openvdb/openvdb_ax/openvdb_ax/compiler/VolumeExecutable.cc
virtual memory exhausted: Cannot allocate memory
/usr/bin/c++ -save-temps -DBOOST_ALL_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK
        40048.52s user 4.21s system 99% cpu 11:07:54.46 total
% du -sh ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii
6.7M    ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii
% cp ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii /tmp
[...]

Then:

malat@amd64 % scp eller.debian.org:/tmp/VolumeExecutable.cc.ii .
malat@amd64 % time /usr/bin/mipsel-linux-gnu-g++-12 -o
VolumeExecutable.o -c VolumeExecutable.cc.ii
/usr/bin/mipsel-linux-gnu-g++-12 -o VolumeExecutable.o -c   853.28s
user 4.38s system 99% cpu 14:17.94 total



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux