Skip to content

cppia: report what keeps a released module loaded #264

Closed

Description

@dimensionscape

After release(), a module's code is freed once nothing reaches it, and __scriptable_cppia_live_modules() counts the modules not freed yet (docs/CppiaModuleRelease.md). When a released module stays loaded, nothing says why, so finding the listener, closure or static that still holds it means guessing.

A call that collects and then reports, for each released module still loaded:

  • the live instances of its classes, by class, with counts and bytes;
  • closures and bound methods of its functions still held;
  • where practical, what holds them: a host static, a root registered from native code, a thread's stack.

It could work in release builds like __hxcpp_gc_census (#82), which already tallies live objects by class during a collection; attributing script classes to their module would cover the first point.

Activity

  1. dimensionscape commented on Oct 22, 2026

    @dimensionscape
    MemberAuthor

    Moving this past 6.0.0. It is a diagnostic, not a defect, and the first point can build on the census from #82 now that it is on main: attributing script classes to their module would give the per-module counts.

  2. added a commit that references this issue on Oct 27, 2026
    b0814db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions