docs: VIEWER_MEMORY_LEAK.md — §SQLJS_CLOSE + §STAFFAGE_TEX_CAP findings (bim-ootb #1488) - #89
Merged
Merged
Conversation
…TAFFAGE_TEX_CAP (bim-ootb #1488) Appends the 2026-08-23 section: sql.js SQL.Database WASM-heap instances as a new resource class for this file's disposal checklist; reachability traced (all A.db/A.libDb/A.cityDb reassignment sites are once-per-page-life — dormant hardening, not an active leak); the libDb-aliases-db trap; the staffage texture cache's bounded-roster analysis and why a dormant size cap beat both candidate clear-triggers; full witness numbers (Duplex + Clinic 3-cycle re-init proof, 116MB geo instance provably closed). NOTE: master does not yet carry this file (its history lives on the unmerged working line, last touched by 1912b65) — this commit introduces it at that line's current content plus the new section, so either merge order resolves to the same text. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Appends the dated section
## 2026-08-23 — sql.js instance leaks + staffage texture cacheto the canonical viewer-memory doc, covering the bim-ootb hardening shipped as red1oon/bim-ootb#1488 (merged):SQL.DatabaseWASM-heap instances — reassignment-without-.close()orphans the full DB copy (100-250MB) in a heap neither GC norrenderer.inforeaches.A.db/A.libDb/A.cityDbreassignment site fires at most once per page life (Ctrl+O replace navigates; merge folds into the live DB; city switches swap cached references) — shipped as dormant defensive hardening, explicitly NOT claimed as a leak fix.A.libDb === A.dbthrough most of the split load — a naive close guard would have closed the live meta DB; conversely the alias sites are where a re-entry would orphan a separate 116MB geo instance. Alias-aware guards, witnessed 3-cycle on Duplex (single-DB) + Clinic (split): prior instances provably closed (execthrows "Database closed"), counts stable, renderer counters flat cycle-over-cycle, 0 page errors._staffageTexCache: bounded 12-file roster + documented session-lifetime design → dormant 2x-roster size cap chosen over both candidate clear-triggers (rationale in the section); dedup proven intact (exactly 12 texture loads across preload + 2 Alt+P presses, 0 evictions).Note for the merger:
masterdoes not yet carryprompts/VIEWER_MEMORY_LEAK.md— its history lives on the unmerged working line (last touched by1912b6583). This PR introduces the file at that line's current content (418 lines, byte-identical) plus the new 60-line section, so either merge order converges on the same text.No auto-merge armed.
🤖 Generated with Claude Code