Compile options to reduce FreeOrion's memory consumption

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Apo
Space Squid
Posts: 89
Joined: Fri Apr 19, 2013 4:10 pm

Compile options to reduce FreeOrion's memory consumption

#1 Post by Apo »

Two of Debian's build servers are running out of memory when compiling FreeOrion. Those are architectures like mips and s390 whose build servers are only equipped with 3 GB physical RAM and 2 GB swap.

I have found this topic about reducing the memory consumption at build time. http://www.freeorion.org/index.php/Comp ... _FreeOrion

What else can I do to reduce the memory consumption besides using just one thread and passing -fno-var-tracking to CFLAGS? (I haven't tried that yet but I'm curious if there are more solutions to this problem) Thanks!

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Compile options to reduce FreeOrion's memory consumption

#2 Post by Dilvish »

As noted here yandonman found that for MSCV optimizing for small code size allowed him to build some components he hadn't been able to before; the corresponding gcc option would be -Os
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Compile options to reduce FreeOrion's memory consumption

#3 Post by adrian_broher »

Where in the compilation process does it run out of memory?
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

Apo
Space Squid
Posts: 89
Joined: Fri Apr 19, 2013 4:10 pm

Re: Compile options to reduce FreeOrion's memory consumption

#4 Post by Apo »

adrian_broher wrote:Where in the compilation process does it run out of memory?
s390 build log
https://buildd.debian.org/status/fetch. ... 1376218408

The build fails with
virtual memory exhausted: Cannot allocate memory
when building GiGi.

mips build log
https://buildd.debian.org/status/fetch. ... 1376265330

Same error message but with the additional BOOST_STATIC_ASSERTION problem in any_regular.hpp:689

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compile options to reduce FreeOrion's memory consumption

#5 Post by Geoff the Medio »

Apo wrote:[The build fails with
virtual memory exhausted: Cannot allocate memory
when building GiGi.
GiGi? I don't imagine the FreeOrion parsers will compile then...

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Compile options to reduce FreeOrion's memory consumption

#6 Post by adrian_broher »

Apo wrote:
s390 build log
https://buildd.debian.org/status/fetch. ... 1376218408

The build fails with
virtual memory exhausted: Cannot allocate memory
when building GiGi.
Please reread the log. It chokes on IntValueRefParser.

Code: Select all

virtual memory exhausted: Cannot allocate memory
make[4]: *** [parse/CMakeFiles/freeorionparse.dir/IntValueRefParser.cpp.o] Error 1
You also build with 4 parallel processes, reduce them to one.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

Apo
Space Squid
Posts: 89
Joined: Fri Apr 19, 2013 4:10 pm

Re: Compile options to reduce FreeOrion's memory consumption

#7 Post by Apo »

adrian_broher wrote:
Apo wrote:
s390 build log
https://buildd.debian.org/status/fetch. ... 1376218408

The build fails with
virtual memory exhausted: Cannot allocate memory
when building GiGi.
Please reread the log. It chokes on IntValueRefParser.

Yep, my bad! Will try with one process again.

Post Reply