* [gentoo-user] Out of memory during GCC compile
@ 2012-02-06 21:33 Grant
2012-02-06 21:44 ` [gentoo-user] " Nikos Chantziaras
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Grant @ 2012-02-06 21:33 UTC (permalink / raw
To: Gentoo mailing list
I'm trying to compile GCC on a remote system with 192MB RAM. It's
completed successfully before but now it uses up all RAM. The compile
doesn't stop but it must be thrashing. I have MAKEOPTS="-j1" in
/etc/make.conf. Am I jeopardizing my HD by letting it swap on the
compile right now? I've ordered an upgrade to the max of 512MB. I've
stopped all processes using up memory that I don't need including X.
Is there anything else I can do to get through the compile with 192MB
RAM?
- Grant
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] Re: Out of memory during GCC compile
2012-02-06 21:33 [gentoo-user] Out of memory during GCC compile Grant
@ 2012-02-06 21:44 ` Nikos Chantziaras
2012-02-06 21:46 ` [gentoo-user] " Paul Hartman
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nikos Chantziaras @ 2012-02-06 21:44 UTC (permalink / raw
To: gentoo-user
On 06/02/12 23:33, Grant wrote:
> I'm trying to compile GCC on a remote system with 192MB RAM. It's
> completed successfully before but now it uses up all RAM. The compile
> doesn't stop but it must be thrashing. I have MAKEOPTS="-j1" in
> /etc/make.conf. Am I jeopardizing my HD by letting it swap on the
> compile right now? I've ordered an upgrade to the max of 512MB. I've
> stopped all processes using up memory that I don't need including X.
> Is there anything else I can do to get through the compile with 192MB
> RAM?
Lowering optimization helps a lot (CFLAGS in make.conf). For example
-O1 or -Os instead of the standard -O2.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Out of memory during GCC compile
2012-02-06 21:33 [gentoo-user] Out of memory during GCC compile Grant
2012-02-06 21:44 ` [gentoo-user] " Nikos Chantziaras
@ 2012-02-06 21:46 ` Paul Hartman
2012-02-06 22:01 ` Robert David
2012-02-07 19:51 ` Florian Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Paul Hartman @ 2012-02-06 21:46 UTC (permalink / raw
To: gentoo-user
On Mon, Feb 6, 2012 at 3:33 PM, Grant <emailgrant@gmail.com> wrote:
> I'm trying to compile GCC on a remote system with 192MB RAM. It's
> completed successfully before but now it uses up all RAM. The compile
> doesn't stop but it must be thrashing. I have MAKEOPTS="-j1" in
> /etc/make.conf. Am I jeopardizing my HD by letting it swap on the
> compile right now? I've ordered an upgrade to the max of 512MB. I've
> stopped all processes using up memory that I don't need including X.
> Is there anything else I can do to get through the compile with 192MB
> RAM?
Use -O0. Don't enable debugging. I think GCC has some switches to
control memory usage/heap limits. You might want to try those and set
them to something low like 16MB, it probably uses as much as it can by
default.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Out of memory during GCC compile
2012-02-06 21:33 [gentoo-user] Out of memory during GCC compile Grant
2012-02-06 21:44 ` [gentoo-user] " Nikos Chantziaras
2012-02-06 21:46 ` [gentoo-user] " Paul Hartman
@ 2012-02-06 22:01 ` Robert David
2012-02-07 19:51 ` Florian Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Robert David @ 2012-02-06 22:01 UTC (permalink / raw
To: gentoo-user; +Cc: emailgrant
V Mon, 6 Feb 2012 13:33:21 -0800
Grant <emailgrant@gmail.com> napsáno:
> I'm trying to compile GCC on a remote system with 192MB RAM. It's
> completed successfully before but now it uses up all RAM. The compile
> doesn't stop but it must be thrashing. I have MAKEOPTS="-j1" in
> /etc/make.conf. Am I jeopardizing my HD by letting it swap on the
> compile right now? I've ordered an upgrade to the max of 512MB. I've
> stopped all processes using up memory that I don't need including X.
> Is there anything else I can do to get through the compile with 192MB
> RAM?
>
> - Grant
>
If you use -pipe as CFLAG remove it.
If not just try lower flags as mentioned (-O0).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Out of memory during GCC compile
2012-02-06 21:33 [gentoo-user] Out of memory during GCC compile Grant
` (2 preceding siblings ...)
2012-02-06 22:01 ` Robert David
@ 2012-02-07 19:51 ` Florian Philipp
3 siblings, 0 replies; 5+ messages in thread
From: Florian Philipp @ 2012-02-07 19:51 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]
Am 06.02.2012 22:33, schrieb Grant:
> I'm trying to compile GCC on a remote system with 192MB RAM. It's
> completed successfully before but now it uses up all RAM. The compile
> doesn't stop but it must be thrashing. I have MAKEOPTS="-j1" in
> /etc/make.conf. Am I jeopardizing my HD by letting it swap on the
> compile right now? I've ordered an upgrade to the max of 512MB. I've
> stopped all processes using up memory that I don't need including X.
> Is there anything else I can do to get through the compile with 192MB
> RAM?
>
> - Grant
>
I noticed a sudden spike in gcc's memory consumption here. I had enough
memory to keep up with it but it still filled ca. 6GB of RAM for a
single .c file. Then it went back down. If you experience the same, I
guess adding swap is reasonable as you won't need it for the whole time.
P.S: Did you consider using a bin-pkg from a different system? You could
also export your root-fs via NFS and compile in a chroot from a
different system.
Regards,
Florian Philipp
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-07 19:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 21:33 [gentoo-user] Out of memory during GCC compile Grant
2012-02-06 21:44 ` [gentoo-user] " Nikos Chantziaras
2012-02-06 21:46 ` [gentoo-user] " Paul Hartman
2012-02-06 22:01 ` Robert David
2012-02-07 19:51 ` Florian Philipp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox