Limit clangd ram and processor usage

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Limit clangd ram and processor usage

Dimitry Andric via cfe-dev
Hi everyone,
I use clangd in Neovim (and CoC). Now the thing is that clangd while working on llvm source code peaks CPU usage on 4 cores. The RAM usage spikes to about 3gb. Is there a way to limit this?
Warm regards,
Deep

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Limit clangd ram and processor usage

Dimitry Andric via cfe-dev
Hi Deep,

Does your system use glibcs ptmalloc2(most linux systems do). If that
is the case, there was an issue with the allocation patterns used in
clangd causing arenas to continuously grow. This has been addressed in
the upcoming clangd-12 release. If that's not the case, would you
consider filing a bug report at https://github.com/clangd/clangd/issues
 please.

~
Nathan James

On Tue, 2021-03-09 at 19:16 +0530, Deep Majumder via cfe-dev wrote:

> Hi everyone,
> I use clangd in Neovim (and CoC). Now the thing is that clangd while
> working on llvm source code peaks CPU usage on 4 cores. The RAM usage
> spikes to about 3gb. Is there a way to limit this?
> Warm regards,
> Deep
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Limit clangd ram and processor usage

Dimitry Andric via cfe-dev
HI Nathan,
How do I ascertain that I have ptmalloc2 on my system (I am on Ubuntu 20.04 btw).
The file /usr/include/malloc.h is not the same as the file at https://github.com/emeryberger/Malloc-Implementations/blob/master/allocators/ptmalloc/ptmalloc2/malloc.h (this is the version of ptmalloc2 I found online).
Warm regards,
Deep

On Tue, Mar 9, 2021 at 7:57 PM Nathan James <[hidden email]> wrote:
Hi Deep,

Does your system use glibcs ptmalloc2(most linux systems do). If that
is the case, there was an issue with the allocation patterns used in
clangd causing arenas to continuously grow. This has been addressed in
the upcoming clangd-12 release. If that's not the case, would you
consider filing a bug report at https://github.com/clangd/clangd/issues
 please.

~
Nathan James

On Tue, 2021-03-09 at 19:16 +0530, Deep Majumder via cfe-dev wrote:
> Hi everyone,
> I use clangd in Neovim (and CoC). Now the thing is that clangd while
> working on llvm source code peaks CPU usage on 4 cores. The RAM usage
> spikes to about 3gb. Is there a way to limit this?
> Warm regards,
> Deep
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Limit clangd ram and processor usage

Dimitry Andric via cfe-dev
Hi Deep,

If you're running a relatively standard linux system such as ubuntu then you're using the platform-standard glibc malloc which was affected by this bug.
If you're using the 11 release or earlier i'm fairly sure the bug Nathan mentioned is the cause.

In that case, can you try https://github.com/clangd/clangd/releases/tag/12.0.0-rc2 (or building from source, or downloading one of the LLVM 12 RC binary releases)?

Cheers, Sam

On Tue, Mar 9, 2021 at 3:42 PM Deep Majumder via cfe-dev <[hidden email]> wrote:
HI Nathan,
How do I ascertain that I have ptmalloc2 on my system (I am on Ubuntu 20.04 btw).
The file /usr/include/malloc.h is not the same as the file at https://github.com/emeryberger/Malloc-Implementations/blob/master/allocators/ptmalloc/ptmalloc2/malloc.h (this is the version of ptmalloc2 I found online).
Warm regards,
Deep

On Tue, Mar 9, 2021 at 7:57 PM Nathan James <[hidden email]> wrote:
Hi Deep,

Does your system use glibcs ptmalloc2(most linux systems do). If that
is the case, there was an issue with the allocation patterns used in
clangd causing arenas to continuously grow. This has been addressed in
the upcoming clangd-12 release. If that's not the case, would you
consider filing a bug report at https://github.com/clangd/clangd/issues
 please.

~
Nathan James

On Tue, 2021-03-09 at 19:16 +0530, Deep Majumder via cfe-dev wrote:
> Hi everyone,
> I use clangd in Neovim (and CoC). Now the thing is that clangd while
> working on llvm source code peaks CPU usage on 4 cores. The RAM usage
> spikes to about 3gb. Is there a way to limit this?
> Warm regards,
> Deep
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Limit clangd ram and processor usage

Dimitry Andric via cfe-dev
Thank you Sam and Nathan! This has solved the memory build up problem.
Warm regards,
Deep

On Thu, 11 Mar, 2021, 7:30 pm Sam McCall, <[hidden email]> wrote:
Hi Deep,

If you're running a relatively standard linux system such as ubuntu then you're using the platform-standard glibc malloc which was affected by this bug.
If you're using the 11 release or earlier i'm fairly sure the bug Nathan mentioned is the cause.

In that case, can you try https://github.com/clangd/clangd/releases/tag/12.0.0-rc2 (or building from source, or downloading one of the LLVM 12 RC binary releases)?

Cheers, Sam

On Tue, Mar 9, 2021 at 3:42 PM Deep Majumder via cfe-dev <[hidden email]> wrote:
HI Nathan,
How do I ascertain that I have ptmalloc2 on my system (I am on Ubuntu 20.04 btw).
The file /usr/include/malloc.h is not the same as the file at https://github.com/emeryberger/Malloc-Implementations/blob/master/allocators/ptmalloc/ptmalloc2/malloc.h (this is the version of ptmalloc2 I found online).
Warm regards,
Deep

On Tue, Mar 9, 2021 at 7:57 PM Nathan James <[hidden email]> wrote:
Hi Deep,

Does your system use glibcs ptmalloc2(most linux systems do). If that
is the case, there was an issue with the allocation patterns used in
clangd causing arenas to continuously grow. This has been addressed in
the upcoming clangd-12 release. If that's not the case, would you
consider filing a bug report at https://github.com/clangd/clangd/issues
 please.

~
Nathan James

On Tue, 2021-03-09 at 19:16 +0530, Deep Majumder via cfe-dev wrote:
> Hi everyone,
> I use clangd in Neovim (and CoC). Now the thing is that clangd while
> working on llvm source code peaks CPU usage on 4 cores. The RAM usage
> spikes to about 3gb. Is there a way to limit this?
> Warm regards,
> Deep
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev