Skip to content

Commit

Permalink
Merge pull request #2324 from opencb/TASK-4853
Browse files Browse the repository at this point in the history
TASK-4853 - OutOfMemoryError running CatalogStorageMetadataSynchronizer
  • Loading branch information
j-coll committed Sep 26, 2023
2 parents d2cb09a + 9ee46e9 commit 29104d2
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 29104d2

Please sign in to comment.