Skip to content

rustc runs out of memory while trying to compile a large static (lazy_static!) HashMap #61513

@ctrlcctrlv

Description

@ctrlcctrlv
    Blocking waiting for file lock on build directory
   Compiling crash v0.1.0 (/home/fred/Workspace/rtuts/crash)
error: Could not compile `crash`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name crash src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=71bdac3a949cee3b -C extra-filename=-71bdac3a949cee3b --out-dir /home/fred/Workspace/rtuts/crash/target/debug/deps -C incremental=/home/fred/Workspace/rtuts/crash/target/debug/incremental -L dependency=/home/fred/Workspace/rtuts/crash/target/debug/deps --extern lazy_static=/home/fred/Workspace/rtuts/crash/target/debug/deps/liblazy_static-7468e7fc38fb612c.rlib` (signal: 9, SIGKILL: kill)

shell returned 101

My machine has 48GB of memory, yet still can't compile the example project, which creates a static hash map at compile time.

I tried both nightly and stable, same thing.

The input source code is only 19M, only containing u32s and strings. This shouldn't happen, GCC could do this no problem.

2019-06-04-161946_2554x1540_scrot

Project crash.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-borrow-checkerArea: The borrow checkerC-bugCategory: This is a bug.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions