fix(ecs): the WASM registry and Entity handles are never freed
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript, wasm
- Domínio
- backend
Direção de pesquisa
Read modules/ecs/src/shared/ecs-library.ts and modules/ecs/src/shared/editor-world.ts at the linked lines, then inspect the Registry cleanup methods in modules/ecs/wasm/Registry.hpp. Trace how __init, clear_entities, and the editor tracker manage handles; done means systems, entities, and the registry are released when the library or tracker is cleared. No test file is named in the issue.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Which package is this bug report for?
ecs
Issue description
EcsLibrary has no __clear and never delete()s its Registry, which holds every component and system through embind handles; each __init instantiates a new WASM module. The editor tracker keeps the Entity handles returned by spawnEntity and never .delete()s them. clear_entities leaves _systems in place. Memory grows with every editor restart and every spawn in live mode.
Where:
modules/ecs/src/shared/ecs-library.ts:51-52modules/ecs/src/shared/editor-world.ts:274-282modules/ecs/wasm/Registry.hpp:182-189
Evidence:
this._module = await this.loadModule({ locateFile: () => wasmUrl });
this._registry = new this._module.Registry();
...
entities.set(entity.getId(), { entity, ... });
Suggested fix: Add a __clear that clears systems and entities, calls registry.delete() and drops the reference. Call entity.delete() when the tracker drops an entity.
Found during a code audit of main at be72076.
Code sample
No response
Versions
- Engine
mainat be72076 - pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority
Medium (should be fixed soon)
I have tested this issue on a development release
be72076
- Linguagem predominante
- TypeScript
- Estrelas
- 7
- Forks
- 2
- Merge médio
- 1d 17h
- PRs com merge (30d)
- 17
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NanoForge-dev/Engine
-
dependencies enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NanoForge-dev/Engine#513 ·
Mantenedores costumam responder em até 1 dia
-
bug chore tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
NanoForge-dev/Engine#511 ·
Mantenedores costumam responder em até 1 dia
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversAbertadocumentation good first issue modules:network
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
NanoForge-dev/Engine#509 ·
Mantenedores costumam responder em até 1 dia
-
documentation modules:ecs packages:asset packages:core
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NanoForge-dev/Engine#508 ·
Mantenedores costumam responder em até 1 dia
-
bug good first issue modules:music modules:sound
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NanoForge-dev/Engine#505 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de NanoForge-dev/Engine
Issues semelhantes
-
Mend: dependency security vulnerability
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 65/100
fdm-monster/fdm-monster#5563 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
growilabs/growi#12246 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededTalvez já em andamento @github-actions assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
SSWConsulting/SSW.Rules#2809 · 1 comentário ·
Mantenedores costumam responder em até 1 dia