<p dir="auto">When creating the npz file, each array is written to a temporary file before adding to a zip archive: <a href="https://github.com/numpy/numpy/blob/master/numpy/lib/npyio.py#L601">https://github.com/numpy/numpy/blob/master/numpy/lib/npyio.py#L601</a></p>
<p dir="auto">This means that if /tmp is close to full, npz file creation will fail even when the actual target device has plenty of space. Even worse, it fails with a cryptic IOError message that doesn't point to /tmp.</p>
<p dir="auto">The size limit causes problems because savez goes through _savez, which creates a temporary file, then zips it. The size limit arises in recent Linux distros -- Ubuntu, Fedora, others -- that have started mounting tmpfs on /tmp. The tmpfs file system is essentially a ram disk and uses memory, which limits the size available. The advantage is spped and that SSD life is extended by not doing large numbers of small writes. On Linux is it probably better to use /var/tmp when writing big temporary files, but probably the easiest solution would be to put the temporary file in the user's directory. It gets deleted in any case.</p>