3

I am extracting large files from zip in a python script like this:

import zipfile
import tempfile

tmpdir = tempfile.mkdtemp()

zf = zipfile.ZipFile('/path/to/file.zip')
zf.extractall(tmpdir)

This works fine but for large files this consumes too much memory to run it on small servers.

Is there a way to control/limit how much memory this extraction uses?

yellowcap
  • 3,985
  • 38
  • 51
  • Possible duplicate of [Python unzipping stream of bytes?](http://stackoverflow.com/questions/12571913/python-unzipping-stream-of-bytes) – Alex Reynolds Jan 08 '16 at 10:06

0 Answers0