I’m on a M2 Macbook Pro using the Dev Container setup. 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.
סיכום מבוסס בינה מלאכותית
High Memory Usage in Dev Container: dsims is experiencing high memory usage with the official Dev Container setup, with 4GB usage at rest and up to 10GB during a build. In comparison, their custom devcontainer.json setup uses only 2GB RAM at rest and 6GB while running Discourse. The official image uses a base image with several features, including apt-packages, ruby, node, rust, redis-server, go, and go-packages-install. jahan_gagan notes that the official image bundles everything needed to run Discourse, resulting in higher memory requirements. dsims asks if others are seeing similar memory usage, and later updates that the usage has decreased to around 6GB after restarting, which they consider “typical”. Any further increases are attributed to a possible memory leak in the dev stack or Docker Desktop.
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”:
"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
התמונה הרשמייתש aims לפשט את הפיתוח על ידי אריזת כל מה שנדרש לרוץ את Discourse בצורה חלקה, במחיר של דרישות זיכרון גבוהות יותר, וההגדרה המותאמת אישית שלך נראית שיש לה שליטה מדויקת על גרסאות וספריות מותקנות.
Are you also seeing the dev image using about 8-10GB RAM?
עכשיו זה סביב 6GB לאחר ההפעלה מחדש של כל הדברים, אז אני עומד להניח שמדובר ב"נורמלי" ולתלות על כל יותר מזה על דליפת זיכרון אפשרית באיזשהו מקום בערמת הפיתוח (כנראה Docker Desktop).