REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
581 stars 94 forks source link

VSCode Perl::LanguageServer causes a process that consumes CPU #642

Open adefaria opened 10 months ago

adefaria commented 10 months ago

When running Perl::LanguageServer inside of VSCode there is a master perl that consumes about 100% of a CPU. Initially, this process fires off a number of pls processes, apparently parsing all of the Perl modules it can find and communicating that data to the master perl process bloating it up to 1.5G in my case. OK, I understand that. There's a lot of Perl code here. However, after it settles down and the pls processes go away the master perl process continues to chew on about 100% of one CPU, even if VSCode is essentially idle.

top - 10:47:37 up 14:32,  1 user,  load average: 0.09, 0.19, 0.22
Tasks: 204 total,   3 running, 201 sleeping,   0 stopped,   0 zombie
%Cpu(s): 22.5 us,  4.3 sy,  0.1 ni, 72.8 id,  0.0 wa,  0.2 hi,  0.1 si,  0.0 st
MiB Mem :   7685.1 total,    427.8 free,   3963.5 used,   3293.8 buff/cache
MiB Swap:   1024.0 total,    942.9 free,     81.1 used.   3405.2 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                                  
   4635 root      20   0 2069884   1.5g   8496 R  99.7  20.6 863:12.92 perl                                                                                                                                                                                     
   4220 root      20   0 1070064 198816  47200 S   2.0   2.5   0:51.59 node                                                                                                                                                                                     
   2021 root      20   0  895920  97960  16820 S   1.3   1.2   2:44.30 python3                      

Closing VSCode causes the master perl process to go away.

An strace of the master perl reveals:

select(16, [3 5 8], [], NULL, {tv_sec=3600, tv_usec=0}) = 1 (in [5], left {tv_sec=3599, tv_usec=999999})
select(16, [3 5 8], [], NULL, {tv_sec=3600, tv_usec=0}) = 1 (in [5], left {tv_sec=3599, tv_usec=999999})
select(16, [3 5 8], [], NULL, {tv_sec=3600, tv_usec=0}) = 1 (in [5], left {tv_sec=3599, tv_usec=999999})
select(16, [3 5 8], [], NULL, {tv_sec=3600, tv_usec=0}) = 1 (in [5], left {tv_sec=3599, tv_usec=999999})
select(16, [3 5 8], [], NULL, {tv_sec=3600, tv_usec=0}) = 1 (in [5], left {tv_sec=3599, tv_usec=999999})

over and over again.

Perl version: 5.36.0 OS: CloudLinux: 8.8 (also experienced on AlmaLinux 8.8 and CentOS 7)

eitsupi commented 10 months ago

I suppose you are on a wrong repo. This repository is not for Perl.

adefaria commented 10 months ago

Can it be moved? Where's the correct repo?

Ah, found it. Sorry. Didn't see this wasn't for Perl.