# Dev Container memory usage really high?

**URL:** https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701
**Category:** Development
**Tags:** dev-install
**Created:** [March 4, 2025, 8:02pm UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701 "2025-03-04T20:02:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 4, 2025, 8:02pm UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/1 "2025-03-04T20:02:19Z")

</div>

I’m on a M2 Macbook Pro using the [Dev Container setup](https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366). Memory usage seems really high, is this typical? I see about 4GB memory usage before running anything, then needing about 10GB to get through a successful build and the full app running at about 8GB.

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 4, 2025, 11:42pm UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/2 "2025-03-04T23:42:26Z")

</div>

Before the official Dev Container config was shared, I had my own `devcontainer.json` that didn’t use the `discourse_dev` base image. It uses only 2GB RAM at rest and 6GB while running Discourse, so I’m curious what the difference could be.

base image: `mcr.microsoft.com/devcontainers/base:debian-12`  
with these “[features](https://containers.dev/implementors/features/)”:

```plaintext
	"features": {
		"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
			"packages": "software-properties-common libpq-dev vim curl expect debconf-utils build-essential zlib1g-dev libssl-dev openssl libcurl4-openssl-dev libreadline6-dev libpcre3 libpcre3-dev imagemagick advancecomp jhead jpegoptim libjpeg-turbo-progs optipng pngcrush pngquant gnupg2"
		},
		"ghcr.io/devcontainers/features/ruby:1": {
			"version": "3.3.4"
		},
		"ghcr.io/devcontainers/features/node:1": {
			"version": "18",
			"pnpmVersion": "9"
		},
		"ghcr.io/devcontainers/features/rust:1": {
			"version": "1.75.0"
		},
		"ghcr.io/itsmechlark/features/redis-server:1": {},
		"ghcr.io/devcontainers/features/go:1": {},
		"ghcr.io/azutake/devcontainer-features/go-packages-install:0": {
			"PACKAGES": "github.com/mailhog/MailHog@latest"
		},
	},	

```

including another container db service running the `postgres:14` image

---

<div class="post-metadata">

### Author: ![jahan\_gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jahan_gagan/32/501948_2.png) [@jahan\_gagan](https://meta.discourse.org/u/jahan_gagan)
#### Post date: [March 4, 2025, 11:49pm UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/3 "2025-03-04T23:49:04Z")

</div>

The official image aims to simplify development by bundling everything needed to run Discourse seamlessly, at the cost of higher memory requirements, and your custom setup seems to have a fine-grained control over versions and installed libraries.

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 5, 2025, 12:12am UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/4 "2025-03-05T00:12:28Z")

</div>

> [@jahan\_gagan](#):
>
> at the cost of higher memory requirements

Are you also seeing the dev image using about 8-10GB RAM?

---

<div class="post-metadata">

### Author: ![dsims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsims/32/485916_2.png) [@dsims](https://meta.discourse.org/u/dsims)
#### Post date: [March 5, 2025, 3:56am UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/5 "2025-03-05T03:56:59Z")

</div>

Now it’s down around 6GB after restarting all the things, so I am going to assume that is “typical” and blame any more than that on a possible memory leak _somewhere_ in the dev stack (probably Docker Desktop).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 4, 2025, 3:57am UTC](https://meta.discourse.org/t/dev-container-memory-usage-really-high/355701/6 "2025-04-04T03:57:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
