Contact SalesSitemapCustomer Login

Go Back   VPSlink Forums > Operating Systems > Gentoo

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2006, 06:35 PM
Junior Member
 
Join Date: Aug 2006
Posts: 18
Lightbulb Compiling with low ram

I actually have been testing out gentoo on a VPSLINK1, compiling anything becomes a real challenge and ulimit doesn't help in that regard. Using -O0 (no optimizations) rathern than -O2 optimiziations does help getting more things to compile, however, being low on resources that may just cause more problems down the road. Looking in the gcc manual, gcc has a garbage collection scheme for the ram it uses.

The parameters ggc-min-expand,ggc-min-heapsize are used to determine when gcc should clean up and dealloc it's unused memory and their defaults are percentages of the total system memory (4gigs) so it's no wonder gcc is having problems.

Setting both to 0, causes compilation to be way too slow, however setting ggc-min-heapsize to 8MB and ggc-min-expand to 0 works pretty well on a VPSLINK1 and I haven't had problems emerging anything with -O2 since (other than things that are running other processes other than gcc such python or ruby then i pretty much have to stop all non necessary services, and then maybe I squeak by).

For clarification I added these flags to my CFLAGS in /etc/make.conf
Code:
--param ggc-min-expand=0 --param ggc-min-heapsize=8192
Reply With Quote
  #2 (permalink)  
Old 08-09-2006, 06:53 PM
Senior Member
 
Join Date: Jun 2006
Location: Guadalajara, Mexico
Posts: 541
Default

thats a tip worth for the wiki
Reply With Quote
  #3 (permalink)  
Old 08-09-2006, 07:21 PM
Junior Member
 
Join Date: Jun 2006
Location: San Diego, CA
Posts: 29
Default

I was having a hard time with some compilations lately. This trick solved my problems. Thanks.
Reply With Quote
  #4 (permalink)  
Old 08-09-2006, 11:04 PM
Administrator
 
Join Date: Feb 2006
Posts: 773
Default

Nice find!
Reply With Quote
  #5 (permalink)  
Old 08-22-2006, 04:06 PM
Junior Member
 
Join Date: May 2006
Posts: 8
Default

Thanks. I'll give this a go.
Reply With Quote
  #6 (permalink)  
Old 08-22-2006, 05:13 PM
Junior Member
 
Join Date: May 2006
Posts: 8
Default

Damn, still probs.
Quote:
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/binu tils-2.16.1-r3/work/binutils-2.16.1/bfd -I. -D_GNU_SOURCE -DTRAD_CORE -I. -I /var/tmp/portage/binutils-2.16.1-r3/work/binutils-2.16.1/bfd -I/var/tmp/portage/ binutils-2.16.1-r3/work/binutils-2.16.1/bfd/../include -I/var/tmp/portage/binut ils-2.16.1-r3/work/binutils-2.16.1/bfd/../intl -I../intl -W -Wall -Wstrict-pro totypes -Wmissing-prototypes -O2 -march=i686 -pipe -c -o elflink.lo /var/tmp/po rtage/binutils-2.16.1-r3/work/binutils-2.16.1/bfd/elflink.c
gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/binutils-2.16.1-r3/work/binutils-2.16 .1/bfd -I. -D_GNU_SOURCE -DTRAD_CORE -I. -I/var/tmp/portage/binutils-2.16.1-r3/w ork/binutils-2.16.1/bfd -I/var/tmp/portage/binutils-2.16.1-r3/work/binutils-2.16 .1/bfd/../include -I/var/tmp/portage/binutils-2.16.1-r3/work/binutils-2.16.1/bfd /../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -march= i686 -pipe -c /var/tmp/portage/binutils-2.16.1-r3/work/binutils-2.16.1/bfd/elfli nk.c -fPIC -DPIC -o .libs/elflink.o

cc1: out of memory allocating 444160 bytes after a total of 3899392 bytes
make[3]: *** [elflink.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/binutils-2.16.1-r3/work/build/bfd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/binutils-2.16.1-r3/work/build/bfd'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/binutils-2.16.1-r3/work/build/bfd'
make: *** [all-bfd] Error 2

!!! ERROR: sys-devel/binutils-2.16.1-r3 failed.
!!! Function toolchain-binutils_src_compile, Line 192, Exitcode 2
!!! emake failed
!!! If you need support, post the topmost build error, NOT this status message.
Reply With Quote
  #7 (permalink)  
Old 08-23-2006, 08:18 AM
Senior Member
 
Join Date: Aug 2006
Posts: 524
Send a message via AIM to kelvinn Send a message via MSN to kelvinn Send a message via Yahoo to kelvinn Send a message via Skype™ to kelvinn
Default

I'll admit, I may have taken the long way out of solving the compiling memory problem: distcc

Yea, no joke, I just have my personal machine setup to compile everything on my VPS, and no more memory errors (a make -j12 is pretty handy).
__________________
Kelvin Nicholson
http://www.helomx.com - Blacklist and availability monitoring built from the ground up for outsourced IT providers.
Reply With Quote
  #8 (permalink)  
Old 08-23-2006, 10:16 AM
Senior Member
 
Join Date: Jun 2006
Location: Guadalajara, Mexico
Posts: 541
Default

lol, how effective is that? i never thought about using it on non-local networks, nice idea
Reply With Quote
  #9 (permalink)  
Old 08-23-2006, 11:12 AM
Senior Member
 
Join Date: Aug 2006
Posts: 524
Send a message via AIM to kelvinn Send a message via MSN to kelvinn Send a message via Yahoo to kelvinn Send a message via Skype™ to kelvinn
Default

Pretty effective -- I compiled Apache and PHP from source, with all the extra configs I wanted, on a Link2. I was surprised how quick it compiled as well.

Then again, I don't claim to be a distcc guru, but at least it got the job done.
__________________
Kelvin Nicholson
http://www.helomx.com - Blacklist and availability monitoring built from the ground up for outsourced IT providers.
Reply With Quote
  #10 (permalink)  
Old 08-23-2006, 03:26 PM
Member
 
Join Date: Jun 2006
Location: Sydney, Australia
Posts: 97
Send a message via ICQ to scotty Send a message via Yahoo to scotty Send a message via Skype™ to scotty
Default

Wow. Thanks. This is very useful.

My home PC is actually older and slower than VPSLink's server here, but it does have plenty of RAM. I've just tested it getting PHP5 compiled. It did not compile faster, but at least I don't have to worry about running out of virtual memory (or have to shut down services while compiling).
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0