php-language-server: memory leak

Project: http://github.com/jens1o/hitbox-api-php (I’d granted you access) (you need to execute composer install) Log: https://hastebin.com/esaximiped.tex

image

Can I help you with something else? I just coded normal(the things from the last php commit) and finally, it freezed.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 1
  • Comments: 42 (19 by maintainers)

Most upvoted comments

Here’s a repo that demonstrates my problem described above. The instructions are in the readme.

So instead of a large project needing to change the default itself (you can add a note to the error that happens) you would rather lock ups peoples systems on linux and do whatever happens on osx/windows?

Idea: in https://github.com/felixfbecker/php-language-server/blob/master/bin/php-language-server.php#L9 instead of setting to -1 simply check the systems memory and make an educated guess for a default, setting it to like 70% of the system or something. Then set the default to false in the extension. If it is false use the 70% or whatever you choose otherwise use whatever is sent in.

What is needing so much memory anyway? Apparently our project is big enough to mean I need a lot to the point I don’t have enough? I have 6 gigs free I think when I froze up last time and then 11gigs of swap on top of that. This project is reasonably large I guess but not to a point I would expect to have so much free to index etc.

You can’t get access to the project but I’m sure when I get time to properly look into this I could just download a framework and come to the same issue if memory is needed so badly.

Also I feel this issue is unrelated to what I am talking about so will just come back when I can and make a new one with findings etc.

I will look into this after #357

I can reproduce it! (I’d maked a detailed look at the RAM usage.) Everytime the server crashes(and boots up again) it won’t flush all of the memory, just around 10 MB. So everytime it crashes, it will allocate more it flushed previous. Infinite loop => out of memory.

The reason why you don’t see this in the logs is also simply explained: Code will only buffer the last start and won’t buffer the rest. So the output I added was just from the last start.