Play stupid games, win stupid prizes xd
[image: 1779993859607-catastrophicfailure.jpg]
TIL: the Duktape JS heap is 133,120 bytes (~130 KB), shared across all loaded zapps. At last in S9PP that is.
Learned this the hard way today — Constantin crashed my watch three times, once into a full firmware restore.
I merged my three view templates into one to fix a button-lock bug during route navigation. Bad idea. Each template is ~30–45 KB; all three loaded simultaneously at onLoad = ~130 KB = 99.4% of the entire heap before ZoneSense even shows up. The system tries to recover by force-unloading the offending zapp, which then reloads, fills the heap again, repeat, until Duktape can’t allocate 1392 bytes and crashes:
WRN UI_FRAMEWORK : JsTotMem 132296/133120
ERR APPLICATION : Zapp: releaseMemoryCb → Zapp 3: ReleaseMem -> unload [×3]
ERR APPLICATION : Zapp: ReleaseMem -> None avail.
ERR DUKTAPE : JSalloc:1392 [×11]
ERR FAULT : A302:duktapeFunctionCombiner.cpp
EVT BOOTLOOP : Bootloop detected, sysmode 5->17
Good to know: ≤ 30–40 KB per feature zapp, one template at a time. With ZoneSense (~30 KB) and Weather (~15 KB) running alongside, headroom is very tight.
The watch is fine. I’ve reverted to the multi-template build. The original nav overlay bug is still open — if anyone’s solved the unload/type="lock" gap problem without blowing the heap, I’d love to hear it.