bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.64k stars 94 forks source link

Memory spikes #712

Closed duncan-qabana closed 5 years ago

duncan-qabana commented 5 years ago

Since a couple of days, I keep getting memory spikes in VSCode caused by this extension.

Although I have "intelephense.maxMemory": 2046, in my settings.json, it keeps spiking to 8GB and over, causing my whole pc to freeze. Because of the freeze, it is hard to get an accurate screenshot of the memory : image

Relevant part of settings.json

{
  "[php]": {
        "editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
    },
   "intelephense.maxMemory": 2046,
   "intelephense.completion.triggerParameterHints": false,
   "intelephense.format.enable": true,
   "intelephense.telemetry.enabled": false,
   "intelephense.files.exclude": [
           "**/.git/**",
           "**/.svn/**",
           "**/.hg/**",
           "**/CVS/**",
           "**/.DS_Store/**",
           "**/node_modules/**",
           "**/bower_components/**",
           "**/vendor/**/{Test,test,Tests,tests}/**",
           "*.twig",
           "*.js",
    ],
}
Enabled extensions - alexdima.copy-relative-path - bmewburn.vscode-intelephense-client - christian-kohler.path-intellisense - CoenraadS.bracket-pair-colorizer-2 - colch.quick-open-prefill-selection - DavidAnson.vscode-markdownlint - DotJoshJohnson.xml - eamodio.gitlens - ecmel.vscode-html-css - eg2.vscode-npm-script - felixfbecker.php-debug - formulahendry.auto-close-tag - Gruntfuggly.todo-tree - humao.rest-client - ikappas.composer - k--kato.intellij-idea-keybindings - kkapsner.duplicateselection - mblode.twig-language - mikestead.dotenv - ms-vscode-remote.remote-containers - ms-vscode-remote.remote-ssh - ms-vscode-remote.remote-ssh-edit - ms-vscode-remote.remote-ssh-explorer - ms-vscode-remote.remote-wsl - ms-vscode-remote.vscode-remote-extensionpack - mtxr.sqltools - mutantdino.resourcemonitor - neilbrayfield.php-docblocker - Nimda.deepdark-material - phproberto.vscode-php-getters-setters - PKief.material-icon-theme - pnp.polacode - pranaygp.vscode-css-peek - redhat.vscode-yaml - royaction.color-manager - Shan.code-settings-sync - shd101wyy.markdown-preview-enhanced - sleistner.vscode-fileutils - WakaTime.vscode-wakatime

If you need more information, please let me know what to give you.

bmewburn commented 5 years ago

Looks like the extension host is using a lot of memory from the screenshot. The intelephense.js process looks low. Is there any further information that indicates that it is this extension causing the problem?

duncan-qabana commented 5 years ago

I have followed the steps on performance issues. I disabled all my extensions and enabled one at the time. The spikes started happening again when I enabled intelephense.

I also tried with every extensions disabled and only intelephense enabled, to see if there were conflicts happening, but the spikes still occured.

I tried the profiling step with only intelephense enabled, but can not get the file to save before my pc freezes.

bmewburn commented 5 years ago

Is it just in a particular workspace? Or triggered by any particular action?

duncan-qabana commented 5 years ago

Just opening a fresh vscode window is enough. No files or folders opened.

I finally got some logs from the debugger, but couldnt get any wiser from it:

ERR Cannot read property 'stack' of undefined: TypeError: Cannot read property 'stack' of undefined at t.onMessage.process.on.t.catch.t (d:\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:783:954)

ERR Object has been destroyed: Error: Object has been destroyed at WebContents.send (D:\Microsoft VS Code\resources\electron.asar\browser\api\web-contents.js:112:15) at w. (D:\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:524:880) at Generator.next () at o (D:\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:13:918)

Extension host terminated unexpectedly. Code: 3765269347 Signal: null _onExtensionHostCrashed @ abstractExtensionService.ts:154

duncan-qabana commented 5 years ago

It seems it is still a conflict. The last crash created a cpuprofile. It mentions intelephense, but also the disabled extension: coenraads.bracket-pair-colorizer-2. I completly removed it and VSCode doesn't freeze anymore. As I can live without colorized brackets, but not without intelephense, I will close this issue :)