Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible memory leak? #1466

Closed
jopit opened this issue Mar 8, 2018 · 5 comments
Closed

Possible memory leak? #1466

jopit opened this issue Mar 8, 2018 · 5 comments

Comments

@jopit
Copy link
Contributor

jopit commented Mar 8, 2018

I pulled and ran the theiaide/theia image from Docker Hub, and left it overnight with a client connected. Using docker stats to monitor the memory usage, when it started it was using 120MB, but after 18 hours of being up but doing nothing, memory was at 215MB.

@marcdumais-work
Copy link
Contributor

marcdumais-work commented Mar 8, 2018

Hi John,

It's possible that it's related to #1284. In that issue, we concentrated mostly on the spectacular virtual memory leak, but there was also an apparent but more modest increase in the resident memory used (that one seemed to stop growing after a few hundred megs).

If you still have your instance running, you might look at the virtual memory being used.

Another potential thing to try is to "stimulate" file watchers by quickly changing a file, within your workspace, and see if the memory seems to leak faster. e.g. run something like:

#!/bin/bash
counter=1
while [ $counter -le 2 ]
do
	echo "a" >> /tmp/file.txt
        sleep 0.01
done

Where you change /tmp/file.txt to point to a file within your workspace

Without such stimulation, there could still be a slower leak, when some Theia extensions trigger file watcher. e.g. the git extension seems to do so once every few seconds.

@jopit
Copy link
Contributor Author

jopit commented Mar 8, 2018

It does look like it's leaking virtual memory:

Thu Mar  8 11:30:08 EST 2018
root     18942  0.1  0.7 123188992 128040 ?    Sl   Mar07   1:27 /usr/local/bin/node /home/theia/node_modules/@theia/core/lib/node/messaging/ipc-bootstrap.js

Thu Mar  8 14:09:25 EST 2018
root     18942  0.1  0.7 140137944 131160 ?    Sl   Mar07   1:38 /usr/local/bin/node /home/theia/node_modules/@theia/core/lib/node/messaging/ipc-bootstrap.js

@marcdumais-work
Copy link
Contributor

Another symptom of this leak is that it clears when the front-end is reloaded.

If that happens too in your case, then this is probably a duplicate of #1284. I think it would be interesting for you to add to that issue, what you reported above, since I think we have not yet documented the leak in resident memory.

We have insulated the problem to the file watcher library we use, called "nsfw", and reported the issue on their GH: Axosoft/nsfw#48 , but had no time yet to dig deeper or try to fix it ourselves.

@jopit
Copy link
Contributor Author

jopit commented Mar 8, 2018

Yes, reloading the front end frees up both the virtual and resident memory

Thu Mar  8 14:40:30 EST 2018
root     31035  4.3  0.2 671096 39492 ?        Sl   14:40   0:00 /usr/local/bin/node /home/theia/node_modules/@theia/core/lib/node/messaging/ipc-bootstrap.js

@marcdumais-work
Copy link
Contributor

closing as duplicate of #1284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants