Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2022-07-04 23:43:47 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-07-04 23:43:47 +0300
commitf94de222c0e4d228a981a493d088fdc1173c3513 (patch)
treeb2bdc64e8f5cd51d68b63b7d001e7a21501f1fa7 /internal
parent5e6ca2cd1e4f6e1eaa9fc09a147a3f2741421c42 (diff)
Null out file slice
Diffstat (limited to 'internal')
-rw-r--r--internal/vfs/zip/archive.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go
index 134842ab..2b04310d 100644
--- a/internal/vfs/zip/archive.go
+++ b/internal/vfs/zip/archive.go
@@ -165,6 +165,11 @@ func (a *zipArchive) readArchive(url string) {
a.addPathDirectory(file.Name)
}
+ // Each file stores a pointer to the zip.reader.
+ // The file slice is not used so we null it out
+ // to reduce memory consumption.
+ archive.File = nil
+
fileCount := float64(len(a.files))
metrics.ZipOpened.WithLabelValues("ok").Inc()
metrics.ZipOpenedEntriesCount.Add(fileCount)