feat: memory measurement script

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev c41765aab44500d18e2f7480947f035233cc2f1e parent 5f0b836
1 file changed, +18 −0
  • scripts/measure-memory.sh +18 −0
diff --git a/scripts/measure-memory.sh b/scripts/measure-memory.sh
new file mode 100755
index 0000000..15e11c4
--- /dev/null
+++ b/scripts/measure-memory.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Memory for each app, measured locally because Carloku doesn't show members
+# memory figures (carlos/platform #365): builds the app's own host binary
+# (make build -> dist/app), runs it on 127.0.0.1 with a fresh database,
+# and records resident memory at rest, at peak under load, and after.
+# Run with nothing else heavy on the machine.
+# scripts/measure-memory.sh [slug...]
+set -uo pipefail
+cd "$(dirname "$0")/.."
+source scripts/env.sh
+ulimit -n 8192 2>/dev/null || true
+slugs=("$@")
+[ ${#slugs[@]} -gt 0 ] || slugs=(go go-rastrillo rust zig ocaml haskell swift nim spinel)
+for s in "${slugs[@]}"; do
+ dir=.worktrees/$s/apps/$s
+ (cd "$dir" && make build >/dev/null 2>&1) || { echo "$s: make build failed"; continue; }
+ bakeoff memory --slug "$s" --dir "$dir" --duration 10s || echo "$s: memory measurement failed"
+done