Skip to content

perf(debian-cve-convert): reduce memory usage and streamline Debian CVE converter - #5713

Merged
jess-lowe merged 3 commits into
google:masterfrom
jess-lowe:perf/debian-cve-mem-consumption
Jul 28, 2026
Merged

perf(debian-cve-convert): reduce memory usage and streamline Debian CVE converter#5713
jess-lowe merged 3 commits into
google:masterfrom
jess-lowe:perf/debian-cve-mem-consumption

Conversation

@jess-lowe

@jess-lowe jess-lowe commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

tl;dr: add a lightweight nvd struct for creating debian records and do gcs download in go

Changes

  • Added vulns.LoadTargetCVEMetadata to decode only essential fields (ID, Published, LastModified, Metrics) from NVD JSONs, bypassing memory-heavy CPE configuration trees, descriptions, and reference lists.
  • Refactored vulnerability generation into buildDebianVulnerabilities() and added runtime.GC() prior to uploading to allow immediate reclamation of intermediate package maps.
  • Added -download-from-gcs flag to download NVD data directly in Go via gcs.DownloadBucket, removing reliance on gcloud storage cp in run_debian_convert.sh.
  • Populated v.Modified timestamps on generated OSV records using NVD lastModified metadata (with fallback to published).

basically, the debian-cve-convert cron job is going to continue to need more and more memory as it loads all of the nvd cve records into memory, and there's been massive dumps of vulns recently (and they will continue to grow) it makes more sense to try and be more conservative about how we handle the memory problems.

@jess-lowe
jess-lowe requested a review from another-rex July 27, 2026 04:15

@another-rex another-rex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread vulnfeeds/cmd/converters/debian/run_debian_convert.sh Outdated
Comment thread vulnfeeds/cmd/converters/debian/main.go Outdated
Comment thread vulnfeeds/vulns/vulns.go
Comment thread vulnfeeds/cmd/converters/debian/main.go
@jess-lowe
jess-lowe requested a review from another-rex July 28, 2026 03:22
another-rex
another-rex previously approved these changes Jul 28, 2026
@jess-lowe
jess-lowe merged commit a5e2378 into google:master Jul 28, 2026
26 checks passed
@jess-lowe
jess-lowe deleted the perf/debian-cve-mem-consumption branch July 28, 2026 05:23
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