Vscode-intelephense: 200% CPU usage after upgrade to 1.0.1

Created on 21 Feb 2019  ·  21Comments  ·  Source: bmewburn/vscode-intelephense

I got auto-upgraded to v1.0.1 today and since then, it's been on 200% CPU usage for 30 mins and the same continues over restarts.

Was there any massive change? Any way to debug?

Is there any way to go back to the previous version?

It's worked well for over 2 years before this on all my projects.

needs more info

Most helpful comment

You can rollback the extension in Visual Studio Code.

Extensions > Intelephense (cogwheel) > Install Another Version.

I've changed to version 0.8.8 and am no longer experiencing issues (experiencing #179).

All 21 comments

You can rollback the extension in Visual Studio Code.

Extensions > Intelephense (cogwheel) > Install Another Version.

I've changed to version 0.8.8 and am no longer experiencing issues (experiencing #179).

Had some other issues with 1.0.1 so I rolledback to 0.8.8 and it seems to have fixed it.

Thanks @soup-bowl . Upgrading to 1.0.2 helped a bit but still no good so I will rollback.

I let it run for an hour yesterday before it died with "JavaScript heap out of memory". After upgrading to 1.0.2, I let it run another 30 minutes but still no good.

Version 0.8.8 is the last one that works fine for me too. After this version, memory is going up to unlimited, CPU is going crazy too.

How many files are in the workspace?

Is there any debugging guide somewhere? There are ~7k files (total 18k but .git, node_modules etc. excluded by adding to "intelephense.files.exclude" and "files.exclude")

As for thousands of files, I know it's not ideal usage but it's a very large project with many relevant plugin dependencies that often to be referenced. And it worked flawlessly earlier and even a cache rebuild used to take a few minutes.

That's unusual then, I've been testing on projects around 10k files and can index the workspace in under a minute with 1.0.2. Is there any errors in the output tab?

I have a project with 250 files, mostly each file under 20 Kb, one single file of 600 Kb.
Reversing to version 0.8.8 makes everything blazing fast, no high CPU at all.
When watching the memory of the process in Task Manager, it increases continuously.. 1GB, 2GB, 3GB.. etc

Unfortunately, there's nothing in output which is why I was wondering if there's any other way to debug it.

Further, I noticed on a _different_ project that did successfully index in 5 minutes (still higher than earlier), that is supposed to have 4k indexable files yet total indexed were 15k. I am guessing the excludes aren't working. Are the excludes taken from files.exclude? I have these settings:

    "intelephense.files.exclude": [
        "**/.git",
        "**/node_modules",
        "**/bower_components",
        "**/vendor"
    ],
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/node_modules": true
    },

I need to exclude vendor (composer) and .git mainly.

I changed the glob lib and I think it only accepts the form **/dirname/** to exclude. Can you give that a try?

{
"intelephense.files.exclude": [
        "**/vendor/**"
    ]
}

you may have to delete the storage directory. The path should be logged to the output channel.

I discovered my project was 40k files, but if I exclude .git/, vendor/ and tempfiles/ (tempfiles is really large because I have a copy of another repository in it, long story) it's only 18k files. Once I ignored those three directories, the extension seems to have stopped spiking to 100%+ of my CPU.

    "intelephense.files.exclude": [
        "**/.git/**",
        "**/vendor/**",
        "**/tempfiles/**"
    ]

could be same as #276

I'm having this same issue. code helper pegs at 300% cpu when this extension is enabled.

If anyone has an open source project or uses a framework that this happens on and can send a link it may help tracking the issue down. Or post/email me the composer.json file if composer is used.

@bmewburn I have this problem with SuiteCRM, albeit with a decent number of customizations: https://github.com/salesagility/SuiteCRM

Once I excluded the files I mentioned above, it took longer for the issue to show up, but it still showed up after a bit.

It may matter that the project used to vendor a lot more of their libraries directly in the repo (we're still on 7.9.17), which inflates the # of files considerably. In the past year or so, a lot of libraries have been moved to being pulled in with composer instead of committed to the repo, so it's probably(?) easier to reproduce the issue with v7.9.17.

7.9.6 and 7.9.x branch worked ok for me ~4300 files in 21s. Could be that the issue here is same as #286 ?

Possibly, though now I can't even reproduce the problem so maybe something in 1.0.4 fixed it? 🤷‍♂️

I'm on 1.0.13 and when I add

"intelephense.files.exclude": [
    "**/.git/**",
    "**/vendor/**",
    "**/tempfiles/**"
]

it stops to consume 100% CPU.

This is a problem for me however, since I often need to "look up" up code that is in the vendor directory.

@elburro1887 can you confirm if it's your vendor directory that is the problem (and not temp files) by removing just it from the exclude settings? If it is then please send me or post your composer.json file.

yes, I have done that and it's definitely the vendor dir.

too be fair, I might be pushing it, since I have about 7 folders in this workspace and each of them has a vendor directory.

Here are the 2 of the larger composer files, let me know if you need more:
https://gist.github.com/elburro1887/1fe047869aac599fce8efdc7c73fef25
https://gist.github.com/elburro1887/91f804fd3dba03d36b02581699e7b2a3

closing, cant repro this and original issue was with 1.0.1. Now on 1.1.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghnp5 picture ghnp5  ·  3Comments

ghost picture ghost  ·  3Comments

vanasis picture vanasis  ·  4Comments

superadmini picture superadmini  ·  4Comments

swashata picture swashata  ·  3Comments