rustup: fail to allocate memory when run `rustup update`
Problem
Fail to allocate memory when I run rustup update on Windows 10 x64 using cmd.exe
C:\Users\home>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: latest update on 2021-05-07, rust version 1.54.0-nightly (676ee1472 2021-05-06)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.2 MiB / 16.2 MiB (100 %) 8.0 MiB/s in 2s ETA: 0s
info: downloading component 'rust-mingw'
info: downloading component 'rust-std'
23.6 MiB / 23.6 MiB (100 %) 8.0 MiB/s in 2s ETA: 0s
info: downloading component 'rustc'
79.8 MiB / 79.8 MiB (100 %) 14.0 MiB/s in 7s ETA: 0s
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-mingw'
info: removing previous version of component 'rust-std'
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'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'clippy'
info: installing component 'rust-docs'
16.2 MiB / 16.2 MiB (100 %) 3.1 MiB/s in 7s ETA: 0s
info: installing component 'rust-mingw'
info: installing component 'rust-std'
23.6 MiB / 23.6 MiB (100 %) 16.1 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
79.8 MiB / 79.8 MiB (100 %) 14.4 MiB/s in 19s ETA: 0s
info: installing component 'rustfmt'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2021-05-07, rust version 1.54.0-nightly (676ee1472 2021-05-06)
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'rust-analyzer-preview'
info: downloading component 'rustfmt'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.2 MiB / 16.2 MiB (100 %) 14.4 MiB/s in 2s ETA: 0s
info: downloading component 'rust-std'
22.9 MiB / 22.9 MiB (100 %) 13.6 MiB/s in 2s ETA: 0s
info: downloading component 'rustc'
59.6 MiB / 59.6 MiB (100 %) 9.6 MiB/s in 8s ETA: 0s
info: removing previous version of component 'rust-src'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'rust-analyzer-preview'
info: removing previous version of component 'rustfmt'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: installing component 'rust-src'
info: installing component 'rust-analysis'
info: installing component 'rust-analyzer-preview'
info: installing component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.2 MiB / 16.2 MiB (100 %) 3.0 MiB/s in 7s ETA: 0s
info: installing component 'rust-std'
22.9 MiB / 22.9 MiB (100 %) 8.0 MiB/s in 11s ETA: 0s
info: installing component 'rustc'
memory allocation of 16777216 bytes failed
C:\Users\home>
Steps
- run
rustup update
Possible Solution(s)
setting the environment variable RUSTUP_UNPACK_RAM to 21474836480 does NOT solve the problem
Notes
Output of rustup --version:
C:\Users\home>rustup --version
rustup 1.24.1 (a01bd6b0d 2021-04-27)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.52.0 (88f19c6da 2021-05-03)`
Output of rustup show:
C:\Users\home>rustup show
Default host: x86_64-pc-windows-msvc
rustup home: D:\.rustup_home
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-gnu
nightly-x86_64-pc-windows-msvc
installed targets for active toolchain
--------------------------------------
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-msvc (default)
rustc 1.52.0 (88f19c6da 2021-05-03)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (13 by maintainers)
Commits related to this issue
- Use rustup beta, see https://github.com/rust-lang/rustup/issues/2759 — committed to hkratz/simd-json by hkratz 3 years ago
- Use rustup beta, which fixes Windows OOM issues See https://github.com/rust-lang/rustup/issues/2759 — committed to rusticstuff/simdutf8 by hkratz 3 years ago
- Use rustup beta, see https://github.com/rust-lang/rustup/issues/2759 — committed to simd-lite/simd-json by hkratz 3 years ago
- Auto merge of #9498 - ehuss:rustup-windows-workaround, r=alexcrichton Add temporary fix for rustup on windows in CI. This adds a temporary fix for rustup on the Windows CI runners. The GitHub image ... — committed to rust-lang/cargo by bors 3 years ago
- Workaround for https://github.com/rust-lang/rustup/issues/2759 in our CI — committed to diesel-rs/diesel by weiznich 3 years ago
- Auto merge of #12180 - weihanglo:remove-tmp-fix, r=epage chore(ci): remove temporary fix for rustup 1.24.1 rust-lang/rustup#2759 was fixed in 1.24.2 and now GitHub ships 1.26.0 [^1]. The temporary w... — committed to rust-lang/cargo by bors a year ago
After changing the version to beta, I was able to see a significant difference. When running rust-analyzer in vscode with rustup version 1.24.1 it took a very long time than usual. With version 1.24.2 beta it took me the usual time again. Maybe rust-analyzer uses rustup internally.
Thank you for addressing this issue and letting us know about the beta testing. I asked one of the users who reported a duplicate issue #2764 on Raspberry Pi 3 to join the beta testing. So far, so good; he verified that Rustup v1.24.2 beta can install the latest Rust stable tool chain without problem.
Raspberry Pi 3 running Raspbian Buster arm32 (
armv7-unknown-linux-gnueabihf)