Skip to content

Commit

Permalink
feat: add how to reduce memory usage while building (#356)
Browse files Browse the repository at this point in the history
* feat: add how to reduce memory usage while building

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

* feat: make options consistent

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

* feat: add symlink-install

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

* Update docs/support/troubleshooting.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/support/troubleshooting.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* feat: add note about trade-off between memory usage and time for building

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>

---------

Signed-off-by: Shin-kyoto <58775300+Shin-kyoto@users.noreply.github.com>
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
  • Loading branch information
Shin-kyoto and kenji-miyake authored Apr 25, 2023
1 parent fecee17 commit f7d04fb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/support/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ MAKEFLAGS="-j4" colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=R
```

You can adjust `-j4` to any number based on your system.
For more details, see the [manual page of GNU make](https://www.gnu.org/software/make/manual/make.html#Parallel-Disable).

By reducing the number of packages built in parallel, you can also reduce the amount of memory used.
In the following example, the number of packages built in parallel is set to 1, and the number of jobs used by `make` is limited to 1.

```bash
MAKEFLAGS="-j1" colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --parallel-workers 1
```

!!! note

By lowering both the number of packages built in parallel and the number of jobs used by `make`, you can reduce the memory usage.
However, this also means that the build process takes longer.

### Errors when using the latest version of Autoware

Expand Down

0 comments on commit f7d04fb

Please sign in to comment.