Skip to content

Conversation

@irenaliu18
Copy link

@irenaliu18 irenaliu18 commented Dec 11, 2025

Summary

  • clear the CycloneDX parser's retained document pointer after parsing so BOM bytes are eligible for GC

Predicates are the assembled ingestion inputs (nodes/edges) that the parser produces for the graph (packages, artifacts, licenses, SBOM edges, vuln metadata, VEX data, etc.). They’re for parsing and once built, they’re handed off to the assembler/backend, and the original BOM bytes are no longer needed.

Implications:
Memory lifecycle: The CycloneDX parser previously held onto the original *processor.Document (and its Blob). By clearing c.doc after predicates are built, we drop reference to the BOM buffer, letting GC reclaim it sooner during ingestion runs. This is for potential accumulation of large BOM byte slices in memory.
Scope: Change is confined to the CycloneDX parser. Outputs/predicates are unchanged; only the parser’s internal pointer is released.

Throughput/load scenarios: Under high-volume CycloneDX ingestion, earlier release of BOM memory can reduce peak heap and GC pressure. It does not change ingestion semantics or ordering, just retention behavior.

Limitations: This doesn’t address other possible retention sources (e.g., collectors, blobstore reads, NATS buffers). It’s a narrow fix for parser-held references in CycloneDX only. Additional profiling would still be needed to rule out other leaks.

@irenaliu18 irenaliu18 changed the title Release CycloneDX doc reference after parse VSYS-13506: Release CycloneDX doc reference after parse Dec 11, 2025
@linear
Copy link

linear bot commented Dec 11, 2025

@irenaliu18 irenaliu18 force-pushed the irenaliu/investigate-memory-issue branch from c7038a1 to e13d316 Compare December 11, 2025 23:43
@irenaliu18 irenaliu18 force-pushed the irenaliu/investigate-memory-issue branch from e13d316 to 2283d15 Compare December 11, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants