Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running out of RAM problem with big ebuilds
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
lfs0a
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2016
Posts: 136

PostPosted: Sun Jun 16, 2024 1:03 pm    Post subject: Running out of RAM problem with big ebuilds Reply with quote

Hi,you all.
I've got a second laptop days ago,and been installing gentoo on it these days.
I got compiled failed this afternoon while I was trying to install clang,
After hours of research,I though it might be RAM problem,
So I add a 8GiB SWAP file(I have 8GiB RAM),and I emerged clang successfully!

So I'm wandering if you guys can check for the amount of RAM+SWAP?

Thank you for your work,you guys have a nice day! :D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54578
Location: 56N 3W

PostPosted: Sun Jun 16, 2024 1:23 pm    Post subject: Reply with quote

lfs0a,

Some ebuilds do that and warn if they will use swap because swap is slow.

You can help things along a bit by using per package MAKEOPTS so that big builds do not need swap because they do less concurrent building.

It's slower than adding real RAM but faster than swap as reading/writing swap does nothing for the build progress.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
lfs0a
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2016
Posts: 136

PostPosted: Sun Jun 16, 2024 2:12 pm    Post subject: Reply with quote

NeddySeagoon wrote:
lfs0a,

Some ebuilds do that and warn if they will use swap because swap is slow.

You can help things along a bit by using per package MAKEOPTS so that big builds do not need swap because they do less concurrent building.

It's slower than adding real RAM but faster than swap as reading/writing swap does nothing for the build progress.


Thanks NeddySeagoon.
It would be better if got warn before compile failure.
Have a nice day!
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3864

PostPosted: Sun Jun 16, 2024 2:40 pm    Post subject: Reply with quote

PORTAGE_TMPDIR="/var/no-tmpfs" instead of default PORTAGE_TMPDIR="/var/tmp" would allow to spare RAM.
Can be set per package the same way as described for MAKEOPTS.e.g.
Code:
user@amd64 ~ $ cat /etc/portage/env/tmpfs-no.conf
PORTAGE_TMPDIR="/var/no-tmpfs"
user@amd64 ~ $ head -1 /etc/portage/package.env/sys-devel::clang.conf
sys-devel/clang tmpfs-no.conf

This could allow to lower MAKEOPTS a little less...

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22684

PostPosted: Sun Jun 16, 2024 2:55 pm    Post subject: Reply with quote

OP: posting here, particularly with so little detail, is unlikely to lead to a change in the clang ebuild. There are multiple variables that effect whether this will work, and without insight into whether you had made choices that clearly cannot work, it's not clear if this is worth adding a rule to prevent. If you want to pursue this, I suggest that you share: your MAKEOPTS, number of concurrent jobs, amount of free RAM before beginning the failed build and, if practical, an estimate of how much memory the build needed in order to succeed.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3864

PostPosted: Sun Jun 16, 2024 3:05 pm    Post subject: Reply with quote

Building -j3 4Gb RAM:
2024-06-08T11:43:13 >>> sys-devel/clang-18.1.7: 2:23:15

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
lfs0a
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2016
Posts: 136

PostPosted: Sun Jun 16, 2024 3:05 pm    Post subject: Reply with quote

CaptainBlood wrote:
PORTAGE_TMPDIR="/var/no-tmpfs" instead of default PORTAGE_TMPDIR="/var/tmp" would allow to spare RAM.
Can be set per package the same way as described for MAKEOPTS.e.g.
Code:
user@amd64 ~ $ cat /etc/portage/env/tmpfs-no.conf
PORTAGE_TMPDIR="/var/no-tmpfs"
user@amd64 ~ $ head -1 /etc/portage/package.env/sys-devel::clang.conf
sys-devel/clang tmpfs-no.conf

This could allow to lower MAKEOPTS a little less...

Thks 4 ur attention, interest & support.


Thanks CaptainBlood,have a nice day!
Back to top
View user's profile Send private message
lfs0a
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2016
Posts: 136

PostPosted: Sun Jun 16, 2024 3:07 pm    Post subject: Reply with quote

Hu wrote:
OP: posting here, particularly with so little detail, is unlikely to lead to a change in the clang ebuild. There are multiple variables that effect whether this will work, and without insight into whether you had made choices that clearly cannot work, it's not clear if this is worth adding a rule to prevent. If you want to pursue this, I suggest that you share: your MAKEOPTS, number of concurrent jobs, amount of free RAM before beginning the failed build and, if practical, an estimate of how much memory the build needed in order to succeed.


MAKEOPTS="-j7"
1 job
8GiB RAM

You have a nice day!
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2435

PostPosted: Sun Jun 16, 2024 3:22 pm    Post subject: Reply with quote

lfs0a wrote:

MAKEOPTS="-j7"
1 job
8GiB RAM


The generally considered safe rule is #threads = RAM(in GBs)/2.

In your case 7 jobs is way too many. It should be 4 or less.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1739
Location: Germany

PostPosted: Sun Jun 16, 2024 3:50 pm    Post subject: Reply with quote

Also, have a look here: https://wiki.gentoo.org/wiki//etc/portage/package.env
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3864

PostPosted: Sun Jun 16, 2024 4:32 pm    Post subject: Reply with quote

My 2c -j5 should be fine with PORTAGE_TMPDIR on disk.
If confirmed, you could test a higher value at next upgrade.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum