Skip to content

Commit

Permalink
storage: Fix OOME on CatalogStorageMetadataSynchronizer for very larg…
Browse files Browse the repository at this point in the history
…e studies #TASK-4853
  • Loading branch information
j-coll committed Aug 14, 2023
1 parent dd2362e commit eb632fa
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,16 @@ protected boolean synchronizeFiles(StudyMetadata study, List<File> files, String
}
fileSamplesMap.put(fileMetadata.getName(), samples);
allSamples.addAll(fileMetadata.getSamples());
if (samples.size() > 100) {
// Try to reuse value.
// If the file holds more than 100 samples, it's most likely this same set of samples is already present
for (Set<String> value : fileSamplesMap.values()) {
if (value.equals(samples)) {
fileSamplesMap.put(fileMetadata.getName(), value);
break;
}
}
}
}

if (!indexedFilesFromStorage.isEmpty()) {
Expand Down

0 comments on commit eb632fa

Please sign in to comment.