Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heavy memory usage when extracting large zip file #22

Open
sculxp opened this issue Jan 3, 2024 · 4 comments
Open

heavy memory usage when extracting large zip file #22

sculxp opened this issue Jan 3, 2024 · 4 comments

Comments

@sculxp
Copy link

sculxp commented Jan 3, 2024

instead of read the whole body into a buffer, can we try zipstream like java ZipInputStream?

github.com/xenking/zipstream

        zr := zipstream.NewReader(&zipFile)
	meta, err := zr.Next()
	if err != nil {
		if err != io.EOF {
			panic(err)
		}
	}
	log.Printf("file name: %s", meta.Name)
	compressedFile, err := ioutil.ReadAll(zr)
	if err != nil {
		panic(err)
	}
	log.Printf("file content: %s", string(compressedFile[:]))

@cmaglie
Copy link
Collaborator

cmaglie commented Aug 5, 2024

@sculxp
can you provide an example that demonstrates the huge memory load?
In theory, we should already support streaming zip files.

@farazkhawaja
Copy link

any update on buffered extraction?

@cmaglie
Copy link
Collaborator

cmaglie commented Nov 4, 2024

@farazkhawaja what do you mean with "buffered extraction"?

@farazkhawaja
Copy link

farazkhawaja commented Jan 4, 2025

Nevermind. What i wanted to ask is what was originally asked. For large tarballs ie; 4-5 gb the pod memory spikes up to 10K-15K Mi during extraction. Is that a known issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants