Skip to content

RUSTUP_UNPACK_RAM seems not too work but is still documented #2919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fishrockz opened this issue Dec 7, 2021 · 5 comments
Closed

RUSTUP_UNPACK_RAM seems not too work but is still documented #2919

fishrockz opened this issue Dec 7, 2021 · 5 comments
Labels
Milestone

Comments

@fishrockz
Copy link

fishrockz commented Dec 7, 2021

Problem

rustup advertises RUSTUP_UNPACK_RAM in https://rust-lang.github.io/rustup/environment-variables.html?highlight=ram#environment-variables

but it seems to do nothing

Steps

  1. rm -rf ~/.rustup
  2. export RUSTUP_UNPACK_RAM=33554432;
  3. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  4. watch htop use about 150MBs ,quite hard to note like this. but on laptop 1.4Gb up to about 1.6Gb, on pi starting with 75MB of 428MB and seems to use all of it. both cases are way more than 33MB

Possible Solution(s)

It could be that I'm doing something stupid but given it seems to happen on more than one device i feel that something is possibly wrong.

Notes

This is blocking the ability to install on small ram systems like rasp-pi-zero-2

Also if RUSTUP_UNPACK_RAM is too small or not parsable then rust up just keep going and crashes your system. To my mind it would be loads better to stop rather than continue.

Rustup version

[will@localhost ~]$ rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.57.0 (f1edd0429 2021-11-29)`
[will@localhost ~]$

Installed toolchains

[will@localhost ~]$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/will/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.57.0 (f1edd0429 2021-11-29)
@fishrockz fishrockz added the bug label Dec 7, 2021
@kinnison
Copy link
Contributor

kinnison commented Dec 8, 2021

So there's a number of potential things here.

  1. htop may be reporting VM size which is not the same as RAM usage. If so, it's very likely overreporting.
  2. The rustup process is likely using more RAM for things other than unpacking, so it will never be as low as the 32M you set.
  3. As for crashing, I'm not sure why we're using a signficant quantity over the expected usage, we should stay fairly low in general, but perhaps memory fragmentation is causing a problem.

@mon
Copy link

mon commented Dec 4, 2022

A bit of a necro, but I was able to install rustc on a 512MB RAM OrangePi (4 cores) by also setting RUSTUP_IO_THREADS=1.

Prior to this, rustup would take 300MiB of RAM then get killed by the OOM killer. With this, the limit seems to be respected a lot more closely.

@chadaustin
Copy link

What's the current workaround? I can't get RUSTUP_UNPACK_RAM to work on a Pi Zero W.

$ RUSTUP_IO_THREADS=1 RUSTUP_UNPACK_RAM=220000000 rustup update
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
714.8 KiB / 714.8 KiB (100 %) 255.7 KiB/s in  3s ETA:  0s
info: latest update on 2024-03-21, rust version 1.77.0 (aedd173a2 2024-03-17)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
 21.0 MiB /  21.0 MiB (100 %)   8.6 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 73.3 MiB /  73.3 MiB (100 %)   7.3 MiB/s in  9s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
warning: during uninstall component cargo was not found
info: removing previous version of component 'clippy'
warning: during uninstall component clippy was not found
info: removing previous version of component 'rust-std'
warning: during uninstall component rust-std was not found
info: removing previous version of component 'rustc'
warning: during uninstall component rustc was not found
info: removing previous version of component 'rustfmt'
warning: during uninstall component rustfmt was not found
info: installing component 'cargo'
  7.7 MiB /   7.7 MiB (100 %) 817.6 KiB/s in 11s ETA:  0s
info: installing component 'clippy'
  2.3 MiB /   2.3 MiB (100 %) 773.3 KiB/s in  5s ETA:  0s
info: installing component 'rust-std'
 21.0 MiB /  21.0 MiB (100 %) 572.8 KiB/s in 31s ETA:  0s
info: installing component 'rustc'
 70.7 MiB /  73.3 MiB ( 96 %) 753.6 KiB/s in  1m 50s ETA:  3smemory allocation of 416427376 bytes failedAborted

@tosiara

This comment was marked as duplicate.

@rami3l
Copy link
Member

rami3l commented Oct 6, 2024

Closing in favor of #3125. Rustup's handling of very little free memory definitely needs some improvement...

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants