You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
I have a project which is a workspace consisting of four members, and when I run cargo build on a 1GB ram kunbus box, when it comes to linking eventually cargo will run out of memory and crash.
Running cargo build --jobs 1 is a workaround, and then linking passes just fine, but it's obviously very very slow on the compiling part.
Steps
Create a workspace with multiple members, and make each member relatively memory-heavy to build.
Run cargo build on low memory system and observe a memory climb until the whole process crashes with error:
error: linking with `cc` failed: exit status: 1
[snip]
= note: collect2: fatal error: ld terminated with signal 9 [Killed]
Run cargo build --jobs 1 and observe linking passing just fine.
Possible Solution(s)
Ideally I would like it to keep using all the jobs it seems sensible to compile, and then do some smartness around linking to see if there is enough memory to actually do the jobs, and if not, reduce jobs to passable amount (or even just 1 for simplicity’s sake).
Notes
Output of cargo version:
cargo 1.53.0 (4369396 2021-04-27)
Tried with toolchains:
nightly-armv7-unknown-linux-gnueabihf
stable-armv7-unknown-linux-gnueabihf
Uname -a:
Linux RevPi47515 4.19.95-rt38-v7 #1 SMP PREEMPT RT Tue, 22 Jun 2021 14:13:31 +0000 armv7l GNU/Linux
Hardware in question: https://shop.pimoroni.com/products/revpi-core-3
Problem
I have a project which is a workspace consisting of four members, and when I run
cargo build
on a 1GB ram kunbus box, when it comes to linking eventually cargo will run out of memory and crash.Running cargo build --jobs 1 is a workaround, and then linking passes just fine, but it's obviously very very slow on the compiling part.
Steps
cargo build
on low memory system and observe a memory climb until the whole process crashes with error:cargo build --jobs 1
and observe linking passing just fine.Possible Solution(s)
Ideally I would like it to keep using all the jobs it seems sensible to compile, and then do some smartness around linking to see if there is enough memory to actually do the jobs, and if not, reduce jobs to passable amount (or even just 1 for simplicity’s sake).
Notes
Output of
cargo version
:cargo 1.53.0 (4369396 2021-04-27)
Tried with toolchains:
nightly-armv7-unknown-linux-gnueabihf
stable-armv7-unknown-linux-gnueabihf
Uname -a:
Linux RevPi47515 4.19.95-rt38-v7 #1 SMP PREEMPT RT Tue, 22 Jun 2021 14:13:31 +0000 armv7l GNU/Linux
Hardware in question: https://shop.pimoroni.com/products/revpi-core-3
Processor | Broadcom BCM2837
Number of cores | 4
Clock rate | 1.2 GHz
RAM | 1 GB
eMMC flash memory | 4 GB
No swap. Setting swap to 100mb only gets that filled up and then crash.
The text was updated successfully, but these errors were encountered: