What does rustup mean by "Defaulting to 500.0 MiB unpack ram"?

When I run a rustup component add command, I get this line at the end:

info: Defaulting to 500.0 MiB unpack ram

I've looked around but can't figure out what it's trying to tell me, or how or why I might want to pick a different default for whatever it is.

According to the environment variable docs.

RUSTUP_UNPACK_RAM unstable (default 400M, min 100M) Caps the amount of RAM rustup will use for IO tasks while unpacking.

Looking at the code it seems to try to figure out how much RAM is free to use for unpacking but caps memory used at 500 MiB by default.

DEFAULT_UNPACK_RAM_MAX appears to be both the "minimum known to work reliably" and the upper limit (unless explicitly overridden by the unstable option). Presumably then, setting it to a lower value is unreliable and setting it to a higher value is unnecessary.

1 Like

Thanks!
It doesn't seem too relevant to the average user. Perhaps it's time to stop reporting that info by default?

1 Like

Yeah it doesn't seem too useful for most people. You might want to open an issue to see if they'll consider removing it or if it's kept for a particular reason.

1 Like
3 Likes

Based on discussions in that github issue, and thanks to Camelid on github, the info message has been improved to this (updated):

info: using up to 500.0 MiB of RAM to unpack components

The issue clarifies the reasons why the message is shown by default, for the time being:

we wanted it visible in logs if anyone reported an issue which might be related to unpack RAM. We have had small system issues in the recent past

If you got here via a web search, see the issue and the documentation if you need to change the RAM allocation for unpacking, etc.

Thanks, team!

3 Likes

You're welcome! :slight_smile:

By the way, the default error message should be:

 info: using up to 500.0 MiB of RAM to unpack components
1 Like