memory-and-disposal
CommunityStop brepjs WASM memory leaks with proper handle cleanup.
Authorandymai
Version1.0.0
Installs0
System Documentation
What problem does it solve?
WASM objects used by brepjs are not tracked by the JavaScript garbage collector, so un-disposed shape and kernel handles cause silent, growing memory leaks that can crash browser-based CAD applications without warning.
Core Features & Use Cases
- Deterministic Handle Cleanup: Guides use of the
usingkeyword,DisposalScope, and scoped helper functions to ensure all WASM handles are freed predictably at the end of their lifetime. - Leak Detection Workflow: Provides step-by-step instructions for using
getDisposalStatsto identify missing disposal calls, peak handle accumulation, and FinalizationRegistry-reclaimed handles. - Kernel-Specific Guidance: Explains the critical difference between occt-wasm arena memory (freed only via kernel dispose calls) and Embind kernel memory (freed directly via handle delete) to debug leaks that only appear on one kernel.
- Use Case: Use this skill when writing new brepjs *Fns.ts operations, debugging unexplained memory growth in the browser playground, or enforcing the
require-using-for-handlespattern checker rule in CI.
Quick Start
Use the memory-and-disposal skill to audit your new brepjs operation code for missing handle disposal calls and fix any WASM memory leak risks.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: memory-and-disposal Download link: https://github.com/andymai/brepjs/archive/main.zip#memory-and-disposal Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.