diff --git a/Lite/Services/ArchiveService.cs b/Lite/Services/ArchiveService.cs index 31d2d5d..9f5f0bb 100644 --- a/Lite/Services/ArchiveService.cs +++ b/Lite/Services/ArchiveService.cs @@ -309,6 +309,14 @@ private void CompactParquetFiles() using var con = new DuckDBConnection("DataSource=:memory:"); con.Open(); + /* Cap memory to avoid multi-GB spikes decompressing large parquet archives. + DuckDB will spill excess to its temp directory automatically. */ + using (var pragma = con.CreateCommand()) + { + pragma.CommandText = "SET memory_limit = '2GB'; SET preserve_insertion_order = false;"; + pragma.ExecuteNonQuery(); + } + var totalMerged = 0; var totalRemoved = 0;