Skip to content

Stream analysis.json output and release L3 AST references after emission #19

Closed as not planned

Description

@sinha108

Is your feature request related to a problem? Please describe.
cango builds the whole analysis.json in memory and marshals it into one []byte. At -a 3 the file reaches 318 MB on the Kubernetes root module and 1.1 GB on cockroach, and peak memory on cockroach is 13.5 GB.

Describe the solution you'd like
Stream the JSON to the output file, module by module. Separately, drop each L3 node's AST pointers (Node.Stmt) once emission has used them, so ASTs are not kept alive through output.

Describe alternatives you've considered
Capping or sampling the graph. Rejected: the spec forbids caps that drop edges (§4.13), because a dropped edge turns into a false "no flow" in taint queries.

Additional context

Activity

  1. sinha108 commented on Oct 25, 2026

    @sinha108
    ContributorAuthor

    Consolidated into #27, which carries this issue's full detail.

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