Git Product home page Git Product logo

Comments (3)

Artaud avatar Artaud commented on September 6, 2024

Since we are very often reading the queue, we might as well have one global queue variable to reduce memory usage.
At this moment, if there is a large queue, we might be needlessly hitting memory limits before the garbage collector has a chance to clear our scoped queue variables.

Or we might just null the scoped queue variables immediately after use.

from fitbit-asap.

daveyjones avatar daveyjones commented on September 6, 2024

The current version of the code base resolves the memory issue by storing only the message IDs in memory—the messages themselves are stored as individual files on disk.

As far as running out of disk space, this library is already self-limiting via the timeout option. For applications where very high disk usage is likely, I think it makes more sense for this to be managed at the application level.

I'm closing this issue for now.

from fitbit-asap.

yiyir avatar yiyir commented on September 6, 2024

Hi @daveyjones, I'm using your library and I'm having similar concerns. I suppose the "timeout" option is not enough to protect against hitting the memory /storage bound. In current source code, this option works to reduce memory overhead when process() is called, but what if the PeerSockect connection is off for a rather long time? Then we would've kept enqueuing (writing to disk) non-stop till we hit the memory bound, which might trigger an exception and potentially crash the app(I'm not sure how Fitbit handles this)? As a developer, I don't want to risk crashing the app or losing newer messages instead of older ones, and nor do I have a callback for calling asap.send() to gain some control over this issue.

Maybe we should call process() more often? e.g. In function enqueue(), instead of calling process() only when queue is previously empty, we call it every time.

from fitbit-asap.

Related Issues (13)

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.