Description
Hi there!
I've discovered what I believe to be a a bug in the currently build for nightly that results in the build process getting OOM'd on my machine. In under ~20 seconds, I can observe Rust take all available RAM (15gb of 16) before it begins to fill up swap as well (8gb). By the 40 second mark, my desktop is largely frozen and the process gets kill around 60 seconds in or so.
I haven't timed these builds but can if specific numbers are needed.
The specific project being built is the first version of the Diesel demo app found on it's landing page. Upon switching the contents of my rust-toolchain file to stable
, the project builds and executes as expected. Here's a link to my code. The only thing you'll need to change is the toolchain file to nightly. Like I said, this will OOM on Linux so be warned.
System stats:
- my current version of rustc:
rustc 1.42.0-nightly (8a79d08fa 2020-01-27)
- my version of linux:
x86_64 Linux 5.4.13-arch1-1
- OS: Arch Linux
As an aside, the demo app uses Diesel 1.0.0
, but I also went ahead and tested it against the most recent released version of 1.4.3
to the same results on nightly.
Update: Here's the output of dmesg for one of the failed attempts to build on nightly:
[240198.230402] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-1.scope,task=cargo,pid=188300,uid=1000
[240198.230413] Out of memory: Killed process 188300 (cargo) total-vm:34595572kB, anon-rss:14876996kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:36180kB oom_score_adj:0
[240198.980499] oom_reaper: reaped process 188300 (cargo), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
So maybe this is more an issue with Cargo?