#!/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