Closed Bug 494068 Opened 15 years ago Closed 15 years ago

Use --no-keep-memory for libxul builds

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: cjones, Unassigned)

Details

Attachments

(1 file)

On my Linux machine (well, VM), linking libxul takes forever and causes heavy swap file usage (bye bye, interactivity).  My machine has 1.5GB of RAM, so I'd estimate ld uses somewhere in the neighborhood of 2GB.

GNU ld has an option "--no-keep-memory" that makes it cache fewer symbol tables.  On my machine, this had a huge effect: the link time was cut by a minute, and my machine didn't swap during linking.

Do we think it's more common for devs to have greater or less than 2 gigs of RAM?  If it's less, then I'd *really* recommend using this by default rather than having developers add it to their mozconfigs.
John, CCing you in case this might help out in releng.
I would expect >2GB to be very common. I'd also expect ld to be smarter, but I realize that's asking a lot :-(
You should be able to just export LDFLAGS="--no-keep-memory" in your mozconfig to use this for linking libxul. I think we should encourage that for people who have less than 2GB of ram, since I'd hate to penalize the folks that do have enough ram. (It's cheap these days!)
(In reply to comment #3)
> You should be able to just export LDFLAGS="--no-keep-memory" in your mozconfig
> to use this for linking libxul. I think we should encourage that for people who
> have less than 2GB of ram, since I'd hate to penalize the folks that do have
> enough ram. (It's cheap these days!)

Would it be a hard hack to add a check for memory to configure?
Does this affect the generated output at all?  Our linux build slaves have 2GB of RAM, and semi-frequently run out of memory while linking.  Setting this up could be a big win on the build machines.
(In reply to comment #5)
> Does this affect the generated output at all?

No, it just affects how ld caches symbol tables in memory.  Or perhaps more importantly, I never had problems with it ;).
Since this flag isn't for everybody and is easy to set in .mozconfig, no need to keep this bug open.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: