fix: stream NVD mirror cache writes#409
Open
johnou wants to merge 1 commit into
Open
Conversation
johnou
commented
Jun 22, 2026
|
|
||
| @SuppressFBWarnings(value = "DM_GC", justification = "Without calling System.gc() the JVM uses 2+GB of memory, calling gc profiling results in less than 1GB") | ||
| private void writeJsonMirror(Object2ObjectOpenHashMap<String, Object2ObjectOpenHashMap<String, DefCveItem>> cves, | ||
| @SuppressFBWarnings(value = "DM_GC", justification = "Manual collection preserves existing mirror memory behavior.") |
Author
There was a problem hiding this comment.
system.gc is probably redundant now, but it may reduce RSS between yearly file writes..
Author
|
@jeremylong ptal when you get a chance, not a blocker but would be a nice to have. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of late the NVD service has been returning 503 responses despite valid API keys. While setting up an NVD proxy, our build node also hit Java heap OOMs with max heap set to 2G..
MAT analysis showed the mirror update path materialized full yearly NVD cache files into Java objects, then copied them into additional map/list structures before writing. This made memory scale with full cache size, not update size.
Before, synthetic 120k CVE cache update:
-Xmx128m: OOM in JacksonPropertyValueBufferCveItem: 120,000After, same synthetic 120k CVE cache update:
-Xmx64m: completedCveItemgraph retained