Coder Social home page Coder Social logo

Possible memory leak about riak-js HOT 17 CLOSED

mostlyserious avatar mostlyserious commented on August 12, 2024
Possible memory leak

from riak-js.

Comments (17)

frank06 avatar frank06 commented on August 12, 2024

Thanks for reporting it. To be honest I have no time to look at it, atm.

I would run a stable Node version (not the 0.3 unstable branch). I've seen recently released 0.2.6 has "Fix various memory leaks (Tom Hughes)" ... you may want to try with that one. If you find any progress please let us know; I'll do my best to dig into this one soon.

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

Update I; I've tried running it with many_listener_warning branch (see nodejs/node-v0.x-archive@bdb1464), and it quite quickly dies with the following:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at Client. (events.js:101:17)
    at [object Object]. (/usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:264:19)
    at /usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:4:36
    at [object Object].save (/usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:157:35)
    at /home/msi/Source/riak/riak-save-test.js:26:5
    at /home/msi/Source/riak/riak-save-test.js:46:3
    at Object. (/home/msi/Source/riak/riak-save-test.js:50:1)
    at Module._compile (node.js:357:32)
    at Object..js (node.js:365:14)
    at Module.load (node.js:288:27)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at Client. (events.js:101:17)
    at [object Object]. (/usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:265:19)
    at /usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:4:36
    at [object Object].save (/usr/local/lib/node/.npm/riak-js/0.3.0beta4/package/lib/http_client.js:157:35)
    at /home/msi/Source/riak/riak-save-test.js:26:5
    at /home/msi/Source/riak/riak-save-test.js:46:3
    at Object. (/home/msi/Source/riak/riak-save-test.js:50:1)
    at Module._compile (node.js:357:32)
    at Object..js (node.js:365:14)
    at Module.load (node.js:288:27

(Note the different like offsets in the second line of the stack traces.)

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

I've tried with 0.3.3 and 0.2.6:

0.2.6 obviously fares better, but it still gets killed after some time...

from riak-js.

frank06 avatar frank06 commented on August 12, 2024

Yea, something seems wrong with those event emitters. I'll take a look at it as soon as I can.

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

FYI, it is not urgent for any of my work (we are researching various kv/document databases for future projects).

from riak-js.

frank06 avatar frank06 commented on August 12, 2024

I pushed 540edef which may be a fix for the leak. My quick tests (on 0.2.6) show memory consumption is much more stable. Let me know if it helps.

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

Seems to be fixed now:

Better data

I'll consider this bug closed now...

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

Oh. And thanks for the quick & great work!

from riak-js.

frank06 avatar frank06 commented on August 12, 2024

Wow the previous situation on the graph is scary! Thanks for reporting the issue

from riak-js.

 avatar commented on August 12, 2024

I'm getting this error message in v0.3.5. Could this be caused by http-proxy or my code, or is the old problem back?

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Pool.<anonymous> (events.js:101:17)
at Object.proxyRequest (/usr/local/lib/node/.npm/http-proxy/0.3.1/package/lib/node-http-proxy.js:185:7)
at /opt/node/bb/lib/vhost.js:247:31
at /opt/node/bb/virt-dispatch.js:9:5
at Server.<anonymous> (/opt/node/bb/virt-dispatch.js:14:9)
at Server.emit (events.js:45:17)
at HTTPParser.onIncoming (http.js:862:12)
at HTTPParser.onHeadersComplete (http.js:85:31)
at Socket.ondata (http.js:787:22)
at Socket._onReadable (net.js:623:27)

from riak-js.

frank06 avatar frank06 commented on August 12, 2024

It doesn't look like it comes from riak-js. Also, the event listener leak should be fixed since 540edef.

  • Exactly which version are you using? Cloned repo or npm?
  • Under which circumstances do you get that message?
  • Do you still get it if you mock riak-js out?

from riak-js.

 avatar commented on August 12, 2024

Sorry to bother you. It was a stupid mistake on my part. Thanks for the reply.

from riak-js.

krasucki avatar krasucki commented on August 12, 2024

hi mchahn,
can you please share the solution?

from riak-js.

skateordie avatar skateordie commented on August 12, 2024

I still have this error, I'm using riak-js cloned repo v0.3.6 and node v0.4.2.
I get this message deleting all the keys in a bucket (~1000 keys), i.e. getting keys from a bucket, iterating over them and performing delete. The perfomance is very low.

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

Yup. I'm getting them too, every now and then. I haven't had the time to dig into it yet, though (also, I'd have to learn a bit of CoffeeScript first).

Edit 1 From my immediate experience, it seems you can force it if you have tonnes of outstanding requests on the same connection.

Edit 2: Using Node 0.4.2 and Riak-js 0.3.6.

from riak-js.

frank06 avatar frank06 commented on August 12, 2024

I haven't tested 0.3.6 on node 0.4.x. Could you try with the 0.4 branch?

from riak-js.

msiebuhr avatar msiebuhr commented on August 12, 2024

I've now had a chance to try it out; using the master-branch, I get the same warnings as mchahn, when running my unit-tests. When switching to 0.4, the -tests run without any hiccups.

from riak-js.

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.