Skip to content

Build parallelism versus link parallelism #1207

Answered by rui314
tepperly asked this question in Q&A
Discussion options

You must be logged in to vote

ninja tries to run as many processes as the number of available cores to maximize parallelism, with an assumption that each process is single-threaded. That assumption is incorrect for mold because mold is itself parallelized. Having more runnable threads than the number of cores is fine, as long as their total working set memory is smaller than the physical RAM size. If your machine grinds to halt due to memory oversubscription, you may want to try to set the MOLD_JOBS environment variable to 1, so that only one mold instances is active. For more info, see https://github.com/rui314/mold/blob/main/docs/mold.md#environment-variables.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tepperly
Comment options

Answer selected by tepperly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants