n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Consistent `Warning: Possible EventEmitter memory leak detected` notification #72

Closed brettvitaz closed 8 years ago

brettvitaz commented 8 years ago

After restarting the javascript kernel and directly following the tenth cell execution, there is a warning that consistently appears in the cell block's stderr output:

(node:274) Warning: Possible EventEmitter memory leak detected. 11 unpipe listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 unpipe listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
(node:274) Warning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit

This does not cause any additional trouble executing cells.

Versions: ijs: 5.0.11 ipython: 5.0.0 npm: 3.10.6 osx: 10.11.6

n-riesco commented 8 years ago

I can't reproduce this issue. I've run more than 10 synchronous cells and more than 10 asynchronous cells and I'm unable to trigger this issue.

Would you be able to share a small notebook that triggers this issue?

brettvitaz commented 8 years ago

Here is an example notebook that triggers the issue.

memory-leak.ipynb.zip

I am able to reproduce the problem on your example docker container ijavascript-node-latest but the problem exists on every system that I've tried.

n-riesco commented 8 years ago

I cannot reproduce this issue in Ubuntu 16.04; i.e: ipython v2.4.1 and node v4.2.6.

I'll setup a VM with the latest node and ipython and see if I can reproduce the isssue.

Out of curiosity, how did you reproduce this issue in the docker container?

brettvitaz commented 8 years ago

I cloned your repo and in the ijavascript-node-latest I ran:

docker build -t ijs .
docker run -p 8888:8888 -ti ijs ./bin/ijavascript.js --ip 0.0.0.0

Fired up chrome, created a new notebook, and started running cells.

n-riesco commented 8 years ago

@brettvitaz Thanks for the docker instructions.

I'm baffled that I can't reproduce this issue (even after following your instructions).

Could you make sure the docker container is running IJavascript v5.0.11?

You can confirm this, by running the following the notebook:

console.log(require("child_process").execSync("git rev-parse HEAD").toString());

It should print out 853fcd4853bffbe3bd9269488030b6f8501796cb.

n-riesco commented 8 years ago

I've just noticed that my local node:latest was a bit stale (v5.5.0).

After a long wait updating the docker image for node:latest (v6.3.1), I can finally reproduce the issue!