Increased RAM usage with 1.14? Resolved: Large crates require more RAM


#1

Is anyone else experienced increased RAM usage requirements with 1.14? I have several build VMs configured with 1GB RAM that have no problems when using 1.13, but fail with out of memory errors about half the time with some larger crates.

Continuing with 1.13 and/or increasing VM specs is OK as a temporary workaround, but is anyone else running into this?

-Tony


#2

Maybe you could pinpoint this issue with perf?


#3

Can you find out is this related to debug info enabled or not (-g flag), and is it related to optimization enabled or not (-Copt-level=3 flag)?


#4

Thanks for the response.

On further inspection, I had updated a dependency around the same time as updating to 1.14.0. The newer version does not build on the smaller specced VM with previous versions of rustc either.

--(0700 AM:101:$)-- cargo b --verbose
   Compiling winapi v0.2.8 (file:///home/awsaba/winapi-rs)
     Running `rustc src/lib.rs --crate-name winapi --crate-type lib -C metadata=0d44ad282bd35975 --out-dir /home/awsaba/ampere-build/target/debug/deps --emit=dep-info,link -L dependency=/home/awsaba/winapi-rs/target/debug/deps`
fatal runtime error: out of memory
error: Could not compile `winapi`.

This is on Ubuntu 16.04 x64. The crate is winapi-rs 0.2.x branch, with this line removed to build: https://github.com/retep998/winapi-rs/blob/0.2/src/lib.rs#L7
At the time, this was easier than obtaining about a half-dozen structs by other means.

I was having the same issue with another crate, postgres 0.13.4, but I can’t seem to reproduce that one as reliably today.

-Tony