GithubHelp home page GithubHelp logo

Memory leak for async gzip about fflate HOT 5 CLOSED

101arrowz avatar 101arrowz commented on May 18, 2024
Memory leak for async gzip

from fflate.

Comments (5)

BlueHotDog avatar BlueHotDog commented on May 18, 2024 1

Hey, we're still investigating on our end. might be an issue on our end.
Closing for now, will re-open once i've more information if applicable.
Thank you so much for the quick response! and sorry for bothering.

from fflate.

101arrowz avatar 101arrowz commented on May 18, 2024

If there's a memory leak, I would think because you are holding on to the references to the stream outputs for too long. After processing a chunk, the async streams drop all references to it, as far as I can tell, but I'll investigate as well.

Also, the second error looks more like an attempt to push the same Uint8Array to AsyncGzip that you use yourself. The docs mention that all pushed chunks are consumed in async streams (they become inaccessible after pushing). If you try to read from some data you've already pushed you may get this error. If it's actually from fflate, please send the full stack trace.

from fflate.

BlueHotDog avatar BlueHotDog commented on May 18, 2024

Unfortunately the error is coming from an extension and is minified so hard to procude a readable trace.
Also still struggling to reproduce locally,
But let me try and give some more context that might help:

  • We're compressing a lot of files(hundreds) from the extension.
  • We're doing it from the extension background page.
  • We're using Rescript, so might be a bit hard to trace down the JS version of that. but from going through the code, the only place where the buffer is being re-used is when an error happened in asyncGzip

Basically the function we've is:
try gzipping, if it succeeds, return the gzipped buffer.
if any error happens(try/catch) return the original buffer

from fflate.

BlueHotDog avatar BlueHotDog commented on May 18, 2024

I suspect a memory leak since when i'm doing two runs and doing a memory compare it seems like a lot of retained buffers are still there.

from fflate.

101arrowz avatar 101arrowz commented on May 18, 2024

Still looking into this issue, maybe it applies to only a specific set of environments. What browser/engine are you using?

from fflate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.