Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when using mouse scroll #4587

Open
2 of 3 tasks
cehteh opened this issue Oct 17, 2024 · 0 comments
Open
2 of 3 tasks

Memory leak when using mouse scroll #4587

cehteh opened this issue Oct 17, 2024 · 0 comments
Labels

Comments

@cehteh
Copy link

cehteh commented Oct 17, 2024

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

When scrolling down with the mouse wheel, CPU usage goes to 100% and memory usage dramatically increases until it hits OOM pretty fast.

I originally reported that at rustic: emacs-rustic/rustic#60

Steps to reproduce

  1. Load rust source file.
  2. Enable lsp-mode (rustic here) with inlay hints and lsp-update-inlay-hints-on-scroll enabled.
  3. Scroll to the bottom of the file.

Expected behavior

No busy loop/not OOM

Which Language Server did you use?

rust-analyzer

OS

Linux

Error callstack

no callstack, but profiler output which helped me to isolate the problem:


    434,170,109  77% - redisplay_internal (C function)
    297,845,620  52%  - lsp--update-inlay-hints-scroll-function
    297,845,620  52%   - lsp-update-inlay-hints
    154,020,004  27%    - lsp-request-async
    141,366,708  25%     - lsp--send-request-async
     68,159,224  12%      - lsp--find-workspaces-for
     66,239,576  11%       - -filter
     65,896,376  11%        - #<compiled 0x10372dd4a6892c93>
     64,864,664  11%         - apply
     64,864,664  11%          - lsp--workspace-method-supported?
     64,864,664  11%           - lsp--capability
     64,223,488  11%              lsp--server-capabilities
        641,176   0%              lsp-get
     53,709,196   9%      - seq-do
     53,709,196   9%       - mapc
     51,991,084   9%        - #<compiled 0x9dfd62054309ff0>
     50,608,780   8%         - lsp--send-no-wait
     50,261,356   8%          - lsp-process-send
     50,261,356   8%           - apply
     50,261,356   8%              #<compiled 0x67f24b53ed105e4>
      7,889,808   1%        #<compiled 0xad33ec27456224>
      3,359,808   0%    - lsp-make-range
      2,090,880   0%     - -partition
      2,090,880   0%      - -partition-in-steps
      1,394,976   0%         dash--partition-all-in-steps-reversed
      1,268,928   0%       #<compiled 0x1c5900af126ac0f5>
      3,357,200   0%      lsp-point-to-position
      3,324,176   0%    - lsp-make-inlay-hints-params
      2,064,480   0%     - -partition
      2,064,480   0%      - -partition-in-steps
      1,377,024   0%         dash--partition-all-in-steps-reversed
      1,259,696   0%       #<compiled 0x1c69f963360ac0f5>


### Anything else?

_No response_
@cehteh cehteh added the bug label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant