Skip to content

Fix OOM Crash During Compilation - #428

Merged
ClayJay3 merged 1 commit into
developmentfrom
hotfix/cmake-optimization
Feb 24, 2026
Merged

Fix OOM Crash During Compilation#428
ClayJay3 merged 1 commit into
developmentfrom
hotfix/cmake-optimization

Conversation

@ClayJay3

Copy link
Copy Markdown
Member

Added some fancy options like Unity builds, LLD, and precompiling to the CMakeLists.txt to hopefully make builds faster and fix crashes on lower-end systems.

@ClayJay3 ClayJay3 self-assigned this Feb 24, 2026
@ClayJay3
ClayJay3 requested a review from a team as a code owner February 24, 2026 04:43
@ClayJay3 ClayJay3 added cleanup Code refactoring or cleanup tasks to remove deprecated features, improve clarity, or ensure code qua dev-environment Issues or enhancements related to setting up or maintaining the development environment. performance Tasks focused on optimizing performance and improving efficiency. labels Feb 24, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ClayJay3, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's compilation process by integrating modern build optimizations. The changes aim to prevent Out-Of-Memory crashes during compilation and accelerate build times, making development more efficient and accessible across various system configurations. These improvements focus on reducing resource consumption and speeding up the linking and compilation phases without altering the project's core logic.

Highlights

  • Compilation Performance: Introduced several optimizations to the CMake build system to improve compilation speed and reduce memory usage, specifically targeting Out-Of-Memory (OOM) crashes on lower-end systems.
  • LLD Linker Integration: Configured CMake to use the LLD linker for non-MSVC builds, which can significantly reduce RAM consumption and linking times.
  • Unity Builds Enabled: Activated Unity Builds (also known as 'Jumbo Builds') with a batch size of 8, consolidating multiple source files into single compilation units to decrease overall compilation time and memory footprint.
  • Precompiled Headers: Implemented precompiled headers for the main executable, unit tests, and integration tests, including heavy libraries such as Eigen, PCL, Torch, and OpenCV, to further reduce compilation overhead.
  • Dev Container Updates: Updated the Dockerfiles for both Jammy and JetPack dev containers to include the LLD linker, ensuring consistency with the new build configurations. The default dev container build was also switched to Jammy.
Changelog
  • .devcontainer/Jammy.dockerfile
    • Added 'lld' to the list of installed packages.
  • .devcontainer/JetPack.dockerfile
    • Added 'lld' to the list of installed packages.
  • .devcontainer/devcontainer.json
    • Changed the default 'dockerfile' build from 'JetPack.dockerfile' to 'Jammy.dockerfile'.
  • CMakeLists.txt
    • Enabled LLD linker for non-MSVC builds to reduce RAM and linking time.
    • Activated Unity Builds with a batch size of 8 to lower memory usage during compilation.
    • Configured precompiled headers for the main executable, including common libraries like '', '', '', '<Eigen/Dense>', '<pcl/point_cloud.h>', '<pcl/point_types.h>', '<torch/torch.h>', and '<opencv2/opencv.hpp>'.
    • Applied the same precompiled header configuration to Unit Tests.
    • Applied the same precompiled header configuration to Integration Tests.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces several performance enhancements to the CMake build system, including the adoption of LLD linker, Unity builds, and precompiled headers. These changes are well-intentioned to address OOM crashes and improve build times, especially on resource-constrained systems. The Dockerfile updates correctly reflect the addition of lld to the build-essential packages. The devcontainer.json change to enable the Jammy.dockerfile build is also noted. Overall, the changes are positive for build optimization.

Comment thread .devcontainer/Jammy.dockerfile
Comment thread .devcontainer/JetPack.dockerfile
Comment thread .devcontainer/devcontainer.json
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt

@frawgii frawgii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved 🤓 🐸

@codacy-production

Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -3.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9a88fbf) 3031 1453 47.94%
Head commit (fd45c59) 3031 (+0) 1453 (+0) 47.94% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#428) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@ClayJay3
ClayJay3 merged commit 32d5eea into development Feb 24, 2026
30 of 34 checks passed
@frawgii frawgii moved this to Backlog in URC 2026 - Autonomy Mar 3, 2026
@frawgii frawgii moved this from Backlog to Ready in URC 2026 - Autonomy Apr 9, 2026
@frawgii frawgii moved this from Ready to Backlog in URC 2026 - Autonomy Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code refactoring or cleanup tasks to remove deprecated features, improve clarity, or ensure code qua dev-environment Issues or enhancements related to setting up or maintaining the development environment. performance Tasks focused on optimizing performance and improving efficiency.

Projects

No open projects
Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants