You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stream analysis.json output and release L3 AST references after emission #19
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
Most of the peak memory is go/packages type information, not L3. L3 adds about 3% over L2. So the main gain is the output buffer.
Activity
sinha108 commentedon Oct 25, 2026
Consolidated into #27, which carries this issue's full detail.