You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Matthias Bläsing (Jira)" <ji...@apache.org> on 2020/12/14 20:16:00 UTC

[jira] [Resolved] (NETBEANS-5142) LSP Client creates excessive processes

     [ https://issues.apache.org/jira/browse/NETBEANS-5142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Bläsing resolved NETBEANS-5142.
----------------------------------------
    Fix Version/s: 12.3
       Resolution: Fixed

Fix was merged to master.

> LSP Client creates excessive processes
> --------------------------------------
>
>                 Key: NETBEANS-5142
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-5142
>             Project: NetBeans
>          Issue Type: Bug
>          Components: lsp
>    Affects Versions: 12.2
>            Reporter: Matthias Bläsing
>            Assignee: Matthias Bläsing
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 12.3
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> It was observed, that while using the typescript editor support in NetBeans to work with angular projects, the whole system became sluggish. Parts of this can be attributed to having `ng serve` running in the background and using many resources when compiling, but that could not be the whole story.
> Checking the task manager showed, that the taskgroup of netbeans contained more than 500 processes. The problem was reproducible.
> Running with a debugger showed, that a breakpoint placed in org.netbeans.modules.typescript.editor.TypeScriptLSP.startServer(Lookup) was hit multiple times in a short time frame although only one file was opened.
> This can be tracked back int org.netbeans.modules.lsp.client.LSPBindings.getBindingsImpl(Project, FileObject, String, boolean) where the map `project2MimeType2Server` provides a cache, that should yield the same LSP server if a project is present or at least the same lsp server for a directory.
> This caching does not work. The cache is a WeakHashMap with an URI as key. The uri is created in the `getBindingsImpl` method and becomes immediately eligible for GC. In consequence the next access will fail to retrieve the previously created LSP as the key got GCed.
> TL;DR: Caching does not work.
> The problem seems to be introduced recently as it was only observed since a few weeks. Most probably it was introduced when support for LSP without project reference was introduced:
> https://github.com/apache/netbeans/commit/74feecb
> At that point the cache was switched from Project to URI. The Project is kept alive by the IDE, so the cache should have worked at that time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists