Skip to content

Commit 960acad

Browse files
committed
Test investigate OOM
1 parent 47c296c commit 960acad

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

.github/actions/smoke-test/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,20 @@ docker network create -d bridge app-network
9191
################################################
9292
echo "Building Dev Container"
9393
readonly ID_LABEL="test-container=${TEMPLATE_ID}"
94+
95+
# Host memory diagnostics before devcontainer up
96+
echo "=== HOST memory diagnostics before devcontainer up ==="
97+
echo "--- Host system memory overview ---"
98+
free -h
99+
echo ""
100+
echo "--- Host detailed memory info ---"
101+
grep -E "MemTotal|MemFree|MemAvailable|Buffers|Cached|SwapTotal|SwapFree" /proc/meminfo
102+
echo ""
103+
echo "--- Host top 15 processes by memory ---"
104+
ps aux --sort=-%mem | head -16
105+
echo ""
106+
echo "--- Docker system info ---"
107+
docker system df
108+
echo "=== End HOST memory diagnostics ==="
109+
94110
devcontainer up --id-label "${ID_LABEL}" --workspace-folder "${SRC_DIR}"

startupscript/post-startup.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,33 @@ ${RUN_AS_LOGIN_USER} "ln -sf '${USER_WORKBENCH_CONFIG_DIR}' '${USER_WORKBENCH_LE
7979
exec > >(tee -a "${POST_STARTUP_OUTPUT_FILE}") # Append output to the file and print to terminal
8080
exec 2> >(tee -a "${POST_STARTUP_OUTPUT_FILE}" >&2) # Append errors to the file and print to terminal
8181

82+
# Memory diagnostics before package installation
83+
echo "=== Memory diagnostics before apt-get update ==="
84+
echo "--- System memory overview (NOTE: this shows HOST memory, not container limits) ---"
85+
free -h
86+
echo ""
87+
echo "--- Detailed memory info ---"
88+
grep -E "MemTotal|MemFree|MemAvailable|Buffers|Cached|SwapTotal|SwapFree" /proc/meminfo
89+
echo ""
90+
echo "--- Cgroup memory limits (actual container limits) ---"
91+
echo "Cgroup v2 memory.max:"
92+
cat /sys/fs/cgroup/memory.max 2>/dev/null || echo "not available"
93+
echo "Cgroup v2 memory.current:"
94+
cat /sys/fs/cgroup/memory.current 2>/dev/null || echo "not available"
95+
echo "Cgroup v2 memory.swap.max:"
96+
cat /sys/fs/cgroup/memory.swap.max 2>/dev/null || echo "not available"
97+
echo "Cgroup v1 memory.limit_in_bytes:"
98+
cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo "not available"
99+
echo "Cgroup v1 memory.usage_in_bytes:"
100+
cat /sys/fs/cgroup/memory/memory.usage_in_bytes 2>/dev/null || echo "not available"
101+
echo ""
102+
echo "--- Top 20 processes by memory (RSS) ---"
103+
ps aux --sort=-%mem | head -21
104+
echo ""
105+
echo "--- Process tree with memory ---"
106+
ps axo pid,ppid,comm,%mem,rss --sort=-%mem | head -30
107+
echo "=== End memory diagnostics ==="
108+
82109
# The apt package index may not be clean when we run; resynchronize
83110
if type apk > /dev/null 2>&1; then
84111
apk update

0 commit comments

Comments
 (0)