-
Notifications
You must be signed in to change notification settings - Fork 895
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
OOM installing rustc-dev with 1GB of memory #3125
Comments
Assigned 2GB and now rustup maxed at 1.55GB. |
Sounds like the general overheads on that platform are higher than we expect. If you reduce RUSTUP_UNPACK_RAM does that help? You can set it to something tiny (e.g. 10 bytes) to get rustup to tell you the minimum it thinks it needs for your system. You can also set it to something huge (10s of gigabytes) to see if Rustup is mis-detecting the RAM available in your system. Currently we estimate 200MB for rustup, IO logic, etc. and then we use detected max ram (https://docs.rs/effective-limits/latest/effective_limits/fn.memory_limit.html) to limit our buffer use to leave at least that estimate free. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@bjorn3 ok, so 1GB does not work now. Have you tried @kinnison 's suggestions - in particular setting RUSTUP_UNPACK_RAM very low? I don't recall any changes to the memory buffer management stuff recently, so not anticipating regressions. Note that the cached component dist files are not memory regulated - but we do only only one in memory cache at a time, and its pull-parsed, so I wouldn't expect a huge footprint. Perhaps running under memgrind or massif or some such would help too. |
I am currently trying to install rustup on a t4g.nano instance running Ubuntu 22.04 and the unpacking is running out of memory.
|
@saethlin Right. Per the linked closed issue installing the Rust tool chain requires at least 1 GB. |
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. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Ah-ha! If I set Which is tricky, because a t4g.nano has 2 vCPUs. |
Another strange variation on this: rust-lang/rust#120406 |
Its not clear to me that there is a bug here with this comment confirming that RUSTUP_UNPACK_RAM + RUSTUP_IO_THREADS can be used to install with only 110MB of RAM usage. |
FWIW I figured out how to install the Rust tool chain on a temporary file system, Linux live USB, starting out with 1 GB of totoal space available here https://rust-lang.github.io/rustup/installation/other.html
|
It would be really nice if the required configuration here were discoverable, or if rustup's attempt to detect available memory discovered the right behavior on its own. At least when I tried it, the logic correctly detected that memory was tight and reduced unpacking memory then OOMed anyway because it opts back in to too much memory via multithreading. |
Maybe we could install panic handler at the top level and print some suggestions when we catch a panic resulting from OOM? Not sure how easy to distinguish those would be programmatically. Seems straightforward and somewhat helpful at least... |
I don't think that will do anything. Allocation failures abort, as far as I can tell re-landing the patch that makes OOM call the panic handler is stuck in limbo with a bunch of concerns about the idea: rust-lang/rust#112331 |
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
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
I attempted to install nightly-2022-12-13-x86_64-unknown-linux-gnu.
The text was updated successfully, but these errors were encountered: