Giter Site home page Giter Site logo

buffer-dispose's People

Contributors

trevnorris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

joaquimserafim

buffer-dispose's Issues

Node v0.10 support and API remarks

Hi Trevor,

I found this project while researching gc issues in our current project that uses lot's of buffer objects. At some point, all the garbage collections we see using --trace_gc are full mark&sweeps due to reaching v8's "external memory allocation limit".

The buffer-dispose you have here seems like a viable solution. Though I wonder whether v0.10 is affected by this just as much as v0.11?

Personally, I would vouch for something like this to make it into node core at some point. Any GC system has to make a tradeof at some point between consistency and performance. In this case, calling free on a buffer remains entirely optional and an optimization.

e.g. .NET gives you the IDisposable pattern to early-release native resources that would else require expensive finalization during garbage collection. This is a similar scenario. Nothing bad happens if you don't free a buffer but if you want more performance you can dispose it. In any case, a disposed buffer should throw exceptions anytime it's beeing accessed (in .NET disposed objects throw ObjectDisposedException), and you need to be careful about disposing elements at the right time (e.g. when working with async callbacks like in node). With a node.js buffer, the native resource is the external memory held.

So, from my point of view, this is nothing out of the ordinary and "dangerous" stuff, it's one of the core things a GC'd platform needs to provide to its developers to allow writing performant code. At it's current state, the buffer handling and gc characteristics make node.js unusable for us (long gc pauses, soft realtime requirements, loads of buffer handling and weak/embedded hardware)

Regards,
Johannes

Cannot install with the latest version of node

npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/buffer-dispose
npm http 200 https://registry.npmjs.org/buffer-dispose
npm ERR! notarget No compatible version found: buffer-dispose@'*'
npm ERR! notarget No valid targets found.
npm ERR! notarget Perhaps not compatible with your version of node?
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! System Windows_NT 6.2.9200

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.