Skip to content

Cargo hits OOM when building many examples #11707

@simply-silver

Description

@simply-silver

Problem

When building examples on a large project with many of them, Cargo quickly runs through all available memory.

Steps

  1. Clone a repository with many examples (e.g. Bevy with 142 examples)
  2. Run cargo build --examples

Possible Solution(s)

It should be possible for Cargo to identify jobs that will consume high amounts of memory and ensure that other high-memory jobs don't occur at the same time.

Notes

No response

Version

cargo 1.67.0 (8ecd4f20a 2023-01-10)
release: 1.67.0
commit-hash: 8ecd4f20a9efb626975ac18a016d480dc7183d9b
commit-date: 2023-01-10
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.86.0-DEV (sys:0.4.59+curl-7.86.0 vendored ssl:OpenSSL/1.1.1q)
os: Arch Linux Rolling Release [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugPerformanceGotta go fast!S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions