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

Memory leak on IE11 #475

Open
wxkin opened this issue Oct 31, 2017 · 3 comments
Open

Memory leak on IE11 #475

wxkin opened this issue Oct 31, 2017 · 3 comments

Comments

@wxkin
Copy link

wxkin commented Oct 31, 2017

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
        })
      });
    }
@dduponchel
Copy link
Collaborator

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
Copy link
Collaborator

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

@wxkin
Copy link
Author

wxkin commented Nov 15, 2017

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?)

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

2 participants