Skip to content

Reduce analysis memory at -a 4 #62

Backlog

Description

@rahlk

Follow-up to #59. The #59 fix removes the full output tree and the full GraphRows from the Neo4j push. It does not reduce the memory that the analysis holds.

Target: cango -i gitea --emit neo4j at -a 4 peaks at 14 GiB or less in a 16 GB container with no swap.
Now gitea passes, but it peaks at 15.8 GiB (margin 0.2 GiB).

Measurements (gitea, live heap after a forced GC)

Stage Live heap Total allocation Memory from the OS
After Analyze (L4) 5.77 GB 88.8 GB 14.6 GB

Largest live allocations after Analyze (gitea heap profile)

  • sdg.sortedPortEdges: 1.47 GB
  • sdg.(*sdgBuilder).fill: 1.42 GB (5.31 GB cumulative)
  • sdg.(*ports).vertices: 0.88 GB
  • sdg.(*ports).callSite: 0.79 GB cumulative
  • sdg.(*sdgBuilder).summaryEdges: 0.74 GB

Questions for the design

  • Can the SDG result be built and consumed one package or one callable at a time?
  • Can the vertex and edge strings be interned or replaced with integer ids until emission?
  • Does a Go heap limit (GOMEMLIMIT) from the cgroup close the gap between the live heap and the memory from the OS?

Activity

  1. rahlk commented on Nov 24, 2026

    @rahlk
    ContributorAuthor

    This work moved into the #59 branch (fix/issue-59-oom-on-large-apps). The user decided that #59 closes only when nats-server and gitea both pass --emit neo4j at -a 4 in a 16 GB container with no swap. See docs/design/specs/2026-11-24-neo4j-streaming-push.md, section 8.

  2. changed the title [-]Analysis memory: run gitea at -a 4 on a 16 GB VM[/-] [+]Reduce analysis memory at -a 4[/+] on Nov 25, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions