jszip icon indicating copy to clipboard operation
jszip copied to clipboard

Memory leak on IE11

Open wxkin opened this issue 9 years ago • 4 comments

Hi there, as part of a Vue.js app, we used the following snippet to compress attached XML files before posting them to the web server. However, on IE11. even a single XML file (The raw XML is about 25MiB) allocates at least 1GB of ram and eventually forces the browser to crash. The same implementation on FF and Chrome works as intended.

Tried different compression options and even removing the HTTP post but did not help. Is there anything we can do?

    onInputFieldChange(fieldName, files){
      let formData = new FormData()
      let zip = new JSZip();

      for (let file of files){
        zip.file(file.name, file);
      }
      
      zip.generateAsync({type:"blob", mimeType: "text/xml",
      compression: "DEFLATE",
      compressionOptions: {
        level: 6
        }
      }, (metadata)=>{
        this.compressingProgressPercent = metadata.percent.toFixed(2);
      }).then((zipfile)=>{
        formData.append(this.uploadFieldName, zipfile);
        
        this.httpPostXml(formData).then(()=>{
          // done
        })
      });
    }

wxkin avatar Oct 31 '17 19:10 wxkin

It looks like the memory leak fixed by #429 (not yet released). Could you try with the master branch ? (you will need to re-generate the dist/ folder with grunt build)

dduponchel avatar Nov 07 '17 22:11 dduponchel

JSZip v3.1.5 has been released and includes the fix from #429. Does it solve the issue ?

dduponchel avatar Nov 09 '17 22:11 dduponchel

Hi dduponchel, Yes in v3.1.5 the memory consumption is normal. However the performance on IE compared to Chrome or Firefox is a different story.

Tested with 4 XML files around 140MiB in total. Chrome(61) -> 14 seconds Firefox(57) -> 13 seconds IE(11) -> 2 minutes 40 seconds

Thanks for your effort ( Should I close this ticket and open a performance related ticket?)

wxkin avatar Nov 15 '17 09:11 wxkin

We won't be fixing any more bugs related to Internet Explorer, as it is not a target we want to support in the future. Closing.

jonkoops avatar Sep 08 '26 16:09 jonkoops