gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commiteefa2dbceefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mreeefa2dbc/plugins/heap/README.md

1.7 KB

  1. # hl:heap
  2. Native diagnostic: `import { snapshot } from 'hl:heap'` then `snapshot()`.
  3. For useful application paths, build a small named value with shared seeds:
  4. ```hl
  5. roots = { search = hlShared(searchIndex), owners = hlShared(shortIdOwners) }
  6. report = snapshot(&roots, 10)
  7. console.log(JSON.stringify(report))
  8. ```
  9. The reference argument prevents a second copy at the call. `hlShared` prevents
  10. copies when assembling the named Hybrid. Do not pass a freshly copied whole graph.
  11. Read SPEC.md “Heap diagnostics” for the exact result and attribution contract.
  12. `byType` and `byRoot` each sum to `objects` and `bytes`. Shared objects belong to
  13. the first seed which reaches them, so changing seed order changes attribution.
  14. `top` ranks those attributed root paths; it does not compute dominators.
  15. Instances reach their constructing instance and handler closures, just as the GC
  16. does; an instance seed can therefore reach other application state.
  17. String/key buffers have their own count/bytes row, separate from descriptors.
  18. Hybrid backing capacity is charged to its header, not counted as another object.
  19. Opaque plugin storage (for example MPackDB native indexes) is excluded.
  20. The call marks without sweeping, yields no fibers, and temporarily uses the GC's
  21. mark bits/gray list. Snapshot-only workspace is mmap'd, released before return,
  22. and never added to the tracked heap. The collector's marks and counters are
  23. restored before constructing the answer. There is no hot-path instrumentation.
  24. Native threads in plugins do not mutate the HL object graph; opaque plugin heaps
  25. are outside this diagnostic. JavaScript and browsers raise a native-only error.
  26. From the repository root, run `python3 tests/heap/test.py` for exact counts, GC stress, fiber/source roots and the JS refusal.

Branches

Latest commits

  • eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre
  • dc77fb95main: offline note from __hlOnline, tick removed (#29)mre
  • 37a86d93tests/reviews: seeded fake hook's DNS failures are not server errors (flaky gate)mre
  • 07ab845bvendor: Hybriel set-day50 (run() leak fix #335)mre
  • 71b2fa4blog: hybriel#335mre
  • bd94cc7elog: #25 cause found (run() leak)mre
  • 565cb508log: H25 round 1mre
  • 90a0af84log: H25 startedmre
  • 87bd53b8mission H25mre
  • 71a746cflog: day48 livemre
  • bf568e14log: V48 mergedmre