-
Notifications
You must be signed in to change notification settings - Fork 41
The default memory limit of php-language-server fails on 32bit PHP on Windows, worth mentioning in the README? #16
Comments
We can definitely specify a memory limit - probably a good idea to make it configurable too. The language server should not be outputting errors on stdout - that channel is used for JSON RPC communication in stdio mode and messages not in that JSONRPC format will cause errors. Might be worth running it always in socket mode to avoid such a problem (we do this on Windows) |
Do you have a link to more information on this? While I can add a configuration switch I would also like it to work out-the-box on Windows x86 and x64. Are you sure the 32-bit x86 is 2MB? Or did you mean 2GB? |
No, I just know that when php-language-server set memory_limit to 4G on 32bit PHP, the error said However, the max memory_limit for 32bit PHP is probably 2GB ("2G"). |
Right the max memory limit defaults to 4GB or 2GB depending on 64-bit or 32-bit. Not sure why php-language-server would interfere with this. |
Not sure, but they do this at the beginning of their code, which attempts to set it to 4GB regardless of 32/64bit:
Not sure why it would fall back to 2MB, though - I couldn't find any info on that by googling. |
New 0.6.2 package has an setting where you can configure the memory limit. I've also reported this to the language-server team so hopefully they'll address it there too. |
php-language-server
sets memory_limit to 4G by default if--memory-limit
isn't specified. This becomes 2MB on 32bit PHP, at least on Windows, and throws a Fatal Error when the language server tries to load stubs. However, this fails silently, sinceide-php
doesn't listen to the language server's stdout. The issue can be fixed by either upgrading to 64bit PHP or specifying a--memory-limit
less than 4G when starting the language server.My suggestions:
--memory-limit
to e.g. "2G" when running php-language-serverchildProcess.stdout.on('data', ...)
) and log it for easier debugging of similar errors in the futureThe text was updated successfully, but these errors were encountered: