Git Product home page Git Product logo

Comments (8)

felixfbecker avatar felixfbecker commented on July 29, 2024 1

I am worried that even when you find a way to reproduce, I cannot think about a way to fix this.

from vscode-php-intellisense.

felixfbecker avatar felixfbecker commented on July 29, 2024

What are you suggesting it to do? It is a child process of VS Code, it should die automatically

from vscode-php-intellisense.

dengorp avatar dengorp commented on July 29, 2024

I can confirm now that the language server processes in some weird cases are not closed with VSCode, after opening multiple projects sometimes it spawns multiple processes which stay up after the VSCode process exits.

While VSCode runs the php processes look normal but after a couple of minutes of closing code, the CPU usage ramps up and start to impact system performance.

I'll try to take some time to further investigate this and figure out a way to reliably reproduce the issue.

from vscode-php-intellisense.

jmcbee avatar jmcbee commented on July 29, 2024

I just noticed this as well. When I quit VS code, the spawned process doesn't exit at all!

from vscode-php-intellisense.

lokken avatar lokken commented on July 29, 2024

screen shot 2017-04-11 at 10 39 28 am

These processes have been collecting since last evening. I let it run overnight to see if they would eventually die but they haven't. I think my computer went to sleep at one point but once I opened it again this morning, they resumed their torture. I have shut down and reopened VSCode several times since last evening. Ah, it seems that a new one is spawned each time I reopen VSCode because after restarting again I now have 6 php processes :)

I'm on a MacBook Air with VSCode 1.11.1 but this issue has been occurring over the course of the last year through each upgrade of VSCode and this extension.

For this case, I was simply in the middle of writing code when things started to get sluggish and the fan starting whirring. How does the indexer decide to start indexing? Does it randomly start up? I don't see anything interesting in devtool console log.

from vscode-php-intellisense.

felixfbecker avatar felixfbecker commented on July 29, 2024

I would accept a PR that implements a poll of the pid passed to initialize at a regular (not too small) interval.

from vscode-php-intellisense.

felixfbecker avatar felixfbecker commented on July 29, 2024

How does the indexer decide to start indexing? Does it randomly start up?

It starts indexing on startup, once. Then it's just parsing of files you change.

I don't see anything interesting in devtool console log.

Look at the output panel instead.

from vscode-php-intellisense.

lokken avatar lokken commented on July 29, 2024

Thanks for the help. I tracked down my particular issue with the code pasted below. The code came from the PHPUnit website but is missing require __DIR__.'/../vendor/phpunit/dbunit/PHPUnit/Extensions/Database/TestCase';, which is what seems to be causing the issue. I do have the DbUnit php extension installed (via composer require --dev phpunit/dbunit). The question is why would this cause the indexer to hang and run indefinitely, even after VSCode is shut down?

Adding the require line and then saving does not fix the issue, so maybe the indexer is too busy in its infinite loop at that point to pick up the change. What does fix the issue is to add the require, shut down VSCode, kill the orphaned php process, and then start VSCode again. At the point, I can see it and everything else get indexed in the output panel.

Hopefully posting this can help with debugging the issue.

<?php

class IntegrationTestCase extends PHPUnit_Extensions_Database_TestCase
{
	private static $pdo = null;
	private $conn = null;

	public function getConnection()
	{
		if ($this->conn === null) {
			if (self::$pdo == null) {
				self::$pdo = new PDO('sqlite::memory:');
			}
			$this->conn = $this->createDefaultDBConnection(self::$pdo, ':memory:');
		}

		return $this->conn;
	}

	public function getDataSet()
	{
		return new PHPUnit_Extensions_Database_DataSet_YamlDataSet(dirname(__FILE__)."/files/integration/integration.yml");
	}
}

from vscode-php-intellisense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.