Zero Hour engine — macOS (Apple Silicon) engine-v0.1.9
engine-v0.1.9 — memory-leak fixes: in-game plateau + no-leak menu option
Native macOS (Apple Silicon) build of the Zero Hour engine. This release stops the
long-session memory growth, in-game and in the menu.
IN-GAME MEMORY GROWTH — FIXED
Symptom: a session started around 950 MB and ratcheted to 2–4+ GB; units died off
late in a match but memory kept climbing, and leaving to the menu added another
~200 MB. Now it plateaus at the battle working set (~1.2–1.5 GB) and recovers
after the match.
Symptom → cause → fix:
- Pool policy = cap-not-decay. Cause: periodically freeing the renderer's GPU
buffer/texture recycle pools was itself the main leak — on Apple Metal each
release of a churned pooled resource becomes a permanent "zombie" backing in
the driver's own never-shrinking pool, while the next allocation takes fresh
device memory (A/B: freeing ratcheted ~13 MB/min; not-freeing was flat at half
the size). Fix: never free in steady state (the pools plateau at the working
set, as the original game does); bound load bursts with flat 256-per-key caps. - Pool thread-safety. Cause: the background texture loader raced the render
thread on unguarded pool maps; corrupted lookups orphaned textures (29k /
2.5 GB in one session). Fix: guard all pool operations with a mutex. - Audio AudioUnit accumulation. Cause: re-binding a sound file detached a still-
playing node, so the audio engine kept its AudioUnit alive (+559 per 3 min of
battle). Fix: stop the node before detaching, in both the 2D and 3D paths. - Map-load GPU balloon. Cause: hundreds of mipmap generations in a single
command buffer made the driver size its pool at the burst peak (~200 MB) and
never shrink. Fix: chunk mip flushes (≤32 per command buffer) with completion
backpressure. - Bot/External-API AIGroup leak: an AI group was created per bot command and
never destroyed. Fix: RAII releaser on every exit path. - Bot/External-API WebSocket backpressure: a slow /events consumer grew an
unbounded in-process send buffer. Fix: skip clients with >4 MB queued (the
event stream is resumable). - Guard-from-Position use-after-free: leaving a match mid-targeting left a decal
pointing into the torn-down shadow manager. Fix: clear the targeting state on
reset.
MENU 3D SCENE (SHELLMAP) — NEW OPT-OUT
Symptom: sitting in the main menu with the animated 3D background grew memory
~130 MB/min (a macOS AGX-driver behaviour tied to the shellmap scene, invariant to
every render/pool knob we tried). Fix: a new GEN_NO_SHELLMAP hook disables just
that scene (static menu background instead), applied after INI loads so a mod's
ShellMapOn setting can't silently re-enable it. The macOS launcher's "Disable menu
3D scene" option (on by default, launcher-v0.1.5) uses it. Note: the engine's
native -noshellmap command-line flag does NOT work with total-conversion mods —
it is parsed before INI, so the mod re-enables the scene.
Apple Silicon (M-series) only. You must own a legitimate copy of Zero Hour — EA
game data is not included. Checksums in SHA256SUMS.