# Excessive consumption of memory due to precompiling assets

**URL:** https://meta.discourse.org/t/excessive-consumption-of-memory-due-to-precompiling-assets/402139
**Category:** Support
**Tags:** unsupported-install
**Created:** [4 במאי,‏ 2026,‏ 2:16pm UTC](https://meta.discourse.org/t/excessive-consumption-of-memory-due-to-precompiling-assets/402139 "2026-05-04T14:16:45Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![trobiyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trobiyo/32/311872_2.png) [@trobiyo](https://meta.discourse.org/u/trobiyo)
#### Post date: [4 במאי,‏ 2026,‏ 2:16pm UTC](https://meta.discourse.org/t/excessive-consumption-of-memory-due-to-precompiling-assets/402139/1 "2026-05-04T14:16:45Z")

</div>

Hi folks,

We have been running our own instances of Discourse in OpenShift for the last years, and in the last months (as of January 2026 approx and more or less aligned with the new approach explained in [Introducing pre-compiled JS assets for self-hosters](https://meta.discourse.org/t/introducing-pre-compiled-js-assets-for-self-hosters/376700) and [Introducing a new build system for plugins](https://meta.discourse.org/t/introducing-a-new-build-system-for-plugins/398713) ), we have observed the following scenario:

When precompiling assets in build time ([`bundle exec rake assets:precompile:build`](https://github.com/discourse/discourse_docker/blob/main/templates/web.template.yml#L238)), this operation now explodes and consumes more than 20Gb:

```plaintext
...
gem install prometheus_exporter -v 2.2.0 -i /var/www/discourse/plugins/discourse-prometheus/gems/3.4.7 --no-document --ignore-dependencies --no-user-install
Successfully installed prometheus_exporter-2.2.0
1 gem installed
Plugin name is 'msgraph-polling', but plugin directory is named 'msgraph-poll-discourse-plugin'
[assemble_ember_build] No existing build info file found.
Fetching and extracting https://get.discourse.org/discourse-assets/2026.5.0-latest-03484cbd/production.tar.gz...
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 20.1M 100 20.1M 0 0 22.5M 0 --:--:-- --:--:-- --:--:-- 22.5M
Prebuilt assets downloaded and extracted successfully.
[assemble_ember_build] Reusing existing core ember build. All done.
Plugin name is 'msgraph-polling', but plugin directory is named 'msgraph-poll-discourse-plugin'
[Plugin::JsManager] Compiling 49 plugins...

# stucks here for long

```

looking at the memory consumption, we see:

```bash
Every 1.0s: free -h webapp-test-discourse-689b5fcb4d-fd2dp-debug-b7nn2: Mon May 4 14:15:57 2026

               total used free shared buff/cache available
Mem: 28Gi 26Gi 596Mi 524Mi 2.1Gi 1.7Gi
Swap: 0B 0B 0B

```

while before was just rather quick with moderated memory consumption.

We have tried setting environment variables like`CI=1` and `NODE_OPTIONS=”-–max-old-space-size=X”`, and nothing seems to help containing this memory consumption.

Is anybody facing the same issue and if so, how did you solve it?

Many thanks!

Ismael

---

_[View the full topic](https://meta.discourse.org/t/excessive-consumption-of-memory-due-to-precompiling-assets/402139)._
