View previous topic :: View next topic |
Author |
Message |
lfs0a Tux's lil' helper
Joined: 19 Oct 2016 Posts: 136
|
Posted: Sun Jun 16, 2024 1:03 pm Post subject: Running out of RAM problem with big ebuilds |
|
|
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! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sun Jun 16, 2024 1:23 pm Post subject: |
|
|
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 |
|
|
lfs0a Tux's lil' helper
Joined: 19 Oct 2016 Posts: 136
|
Posted: Sun Jun 16, 2024 2:12 pm Post subject: |
|
|
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 |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3838
|
Posted: Sun Jun 16, 2024 2:40 pm Post subject: |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22601
|
Posted: Sun Jun 16, 2024 2:55 pm Post subject: |
|
|
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 |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3838
|
Posted: Sun Jun 16, 2024 3:05 pm Post subject: |
|
|
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 |
|
|
lfs0a Tux's lil' helper
Joined: 19 Oct 2016 Posts: 136
|
Posted: Sun Jun 16, 2024 3:05 pm Post subject: |
|
|
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 |
|
|
lfs0a Tux's lil' helper
Joined: 19 Oct 2016 Posts: 136
|
Posted: Sun Jun 16, 2024 3:07 pm Post subject: |
|
|
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 |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2387
|
Posted: Sun Jun 16, 2024 3:22 pm Post subject: |
|
|
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 |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1712 Location: Germany
|
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3838
|
Posted: Sun Jun 16, 2024 4:32 pm Post subject: |
|
|
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 |
|
|
|