rustup: OOM installing rustc-dev with 1GB of memory
Problem
I tried installing a rust toolchain in a VM I assigned 1GB of ram. (100MB used by the minimal debian install) When installing rustc-dev it got an OOM however.
Steps
- Create a VM
- Assign 1GB of ram
- Install a minimal debian system in the VM. When running it only uses 100MB of ram.
- Attempt to install a rust toolchain with the rustc-dev component in the VM.
- OOM
Possible Solution(s)
I thought rustup 1.24 enabled installation on systems with little ram. Is this a regression? Would it be possible to stream the component rather than attempt to load it all at once in memory?
Notes
For now I will be increasing the assigned amount of memory, but IMO it should be possible to install on systems with this little ram, hence this issue.
Rustup version
rustup 1.25.1 (bb60b1e89 2022-07-12)
Installed toolchains
Default host: x86_64-unknown-linux-gnu
rustup home: /home/bjorn/.rustup
no active toolchain
I attempted to install nightly-2022-12-13-x86_64-unknown-linux-gnu.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 20 (12 by maintainers)
I am not interested in your tmpfs use case.
I am currently trying to install rustup on a t4g.nano instance running Ubuntu 22.04 and the unpacking is running out of memory.
free -hlooks like this:The linked closed issue is about installing in a tmpfs mount, i.e. a system where disk and memory together come out of a 1 GB pool. I am trying to install on a system with 128 GB of disk and 500 MB of memory (less than that in practice because OS, but you know).
I’ve forked rustup and started poking at this situation. I’ll try to write a patch myself, but if push comes to shove I’ll just set up a lot of swap.
You might slightly exceed it if you use a real disk (maybe using the minimal profile works to fit in 1GB), but if the filesystem is stored in ram, you definitively need more than 1GB of ram to fit both the filesystem and the rustup installer process.