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

VSCode Remote Container with Intelephense causes resource starvation and node crashes #874

Closed
wknechtel opened this issue Dec 12, 2019 · 4 comments

Comments

@wknechtel
Copy link

@wknechtel wknechtel commented Dec 12, 2019

Describe the bug
Intelephense becomes very resource hungry when indexing and causes node to crash, while used in conjunction with the VSCode Remote/Container Attachment. It sometimes causes the container to become non-responsive, and never seems to fully complete its indexing (The Intelephense Indexing spinny-wheel doesn't go away, even after a couple of days of letting it run), and leaves behind these crash reports: report.20191212.073711.88698.0.001.json.txt (I appended .txt to get the bug tool to accept my file).

I've tried allowing as much as 2GB RAM to Intelephense to let it do its thing, and wound up having to scale it back or it would choke the container.

To Reproduce
This happens when developing for Magento, which is a very large codebase. I use a derivative of my Magento Open Source package for Magento Commmerce Cloud development. I allow 6 processor cores and 6GB RAM for the Docker VM. I install VSCode Remote and Intelliphense into the container's vscode server, and when I open a folder that contains php code, intelliphense goes to work indexing the project.

Expected behavior
Um, index and not crash? ;-)

Screenshots
N/A

Platform and version
I'm running Win10 Pro (1809), VSCode 1.40.2, Intelephense 1.3.3 (premium), and Docker Desktop 2.1.0.5 to host an Ubuntu 1804 container.

@bmewburn

This comment has been minimized.

Copy link
Owner

@bmewburn bmewburn commented Dec 15, 2019

I've made a slight change in 1.3.5. Unfortunately larger workspaces do use quite a bit of memory. In my 1.3.5 tests indexing magento 2 (30k files) takes up ~600MB after GC but spikes to ~1.2GB at times during indexing. I'll see if some improvements can be made here.

@bmewburn

This comment has been minimized.

Copy link
Owner

@bmewburn bmewburn commented Dec 18, 2019

Found a memory leak were large string were being held onto. Fixed in 1.3.6. Does this improve things at all? In my tests on my i5 laptop magento2 indexes in around 90s and uses 500MB memory after GC.

@wknechtel

This comment has been minimized.

Copy link
Author

@wknechtel wknechtel commented Dec 18, 2019

EDIT: I didn't see your most recent post until after posting this tome. I'll update to 1.3.6 and get back to you :-)

I updated to 1.3.5 and tried again. With the amount of allowed memory set to 1024MB I was still getting crash reports about it being out of memory. I increased it to 3096 (You mentioned 30k files for Magento 2 - when you move to the enterprise edition, it shoots up to 51k. Oof.) and that particular behavior went away. However, it's still binding up the procs. While idling, the load average on this particular docker instance hovers around 0.12. During the first couple of hours I was letting it index it was between 2 and 6 or so, and it was peaking near 18. Once the load average approaches 5 or so, the connection to the instance starts getting spotty. I let it run overnight, thinking that it would be done by the time I got back to it this morning, since it wasn't crashing anymore. No such luck, I'm afraid, When I got in this morning it was bound up with the load average being over 60.

I did notice that at times the number of instances of indexers was around 12 or so. Is there a way, perhaps, of limiting the number of indexers, so that while it will take longer to index, it won't bind up the instance? I'm attaching this screenshot just so you can see how the load averages are peaking.

2019-12-18 08_15_46-remove_ALL_orders sql - billknechtel  Attached Container magento-cloud-dev_mclou

@wknechtel

This comment has been minimized.

Copy link
Author

@wknechtel wknechtel commented Dec 18, 2019

That did it! You, sir, are fantastic. It indexed in a reasonable amount of time and let me get on with things. Thanks so very much!

@wknechtel wknechtel closed this Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.