Skip to content

[Bug]: Memory leak? #5201

Open
Open
@aghasemi

Description

@aghasemi

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: macOS, ChromeOS
  • Remote OS: Ubuntu 20.04, 22.04
  • Remote Architecture: x86-64
  • code-server --version: 4.2.0, 4.3.0

Hi,

The memory consumed by the code-server (node) process gradually increases over time, regardless of whether and how the IDE is used. I have tested it multiple times and it has eventually used up all the 8GiB RAM of the server machine in a matter of 2 or so weeks.

Is this a well-known problem? Can I solve it permanently instead of rebooting the sever each time?

Many thanks

Steps to Reproduce

  1. Install code-server and run its daemon
  2. Continually measure memory usage of the process
  3. Wait :)

Expected

The memory usage should not be monotonically increasing

Actual

It is

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

Activity

added
bugSomething isn't working
triageThis issue needs to be triaged by a maintainer
on May 13, 2022
benz0li

benz0li commented on May 13, 2022

@benz0li
Contributor

I can confirm that the memory consumed by the code-server (node) process gradually increases over time.

jsjoeio

jsjoeio commented on May 13, 2022

@jsjoeio
Contributor

Does this also happen with native VS Code?

Side note: this would be a fun problem to solve. I'm not sure how, but I'm sure there are tools we could use to figure it out.

added
waiting-for-infoWaiting for more information from submitter
and removed
bugSomething isn't working
triageThis issue needs to be triaged by a maintainer
on May 13, 2022
aghasemi

aghasemi commented on May 14, 2022

@aghasemi
Author

Does this also happen with native VS Code?

No. I have VSCode continually open on a MacBook for weeks and never had a memory issue. Same for a ChromeOS device.

added
needs-investigationThis issue needs to be further investigated
and removed
waiting-for-infoWaiting for more information from submitter
on May 19, 2022
added this to the Backlog milestone on May 19, 2022
LaCocoRoco

LaCocoRoco commented on May 23, 2022

@LaCocoRoco

I have the same / similiar problem on debian 11 with code server 4.4.0. Couldn't find the reason yet. When the memory is full, all sessions start to slow down, freeze and finally crash (Probably the memory leaking component / extension shuts down). Is there a way to pinpoint down this issue (Enable debug log as example)? I also thought to temporarily increase the Cloud Memory from 4GB to 8GB.

aghasemi

aghasemi commented on May 23, 2022

@aghasemi
Author

I also thought to temporarily increase the Cloud Memory from 4GB to 8GB.

My "solution" was adding a line to crontab to restart code-server every 24 hours 😆

benz0li

benz0li commented on May 24, 2022

@benz0li
Contributor

Side note: this would be a fun problem to solve. I'm not sure how, but I'm sure there are tools we could use to figure it out.

https://www.npmjs.com/package/heapdump?

LaCocoRoco

LaCocoRoco commented on May 25, 2022

@LaCocoRoco

Today the system used 3.4GB of 4GB. I killed the extension volar and it droped by 3GB. Once i also read about memory problems with the extension settings sync. Is there a way to limit the ram usage of installed extensions?

15 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-investigationThis issue needs to be further investigated

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jsjoeio@aghasemi@LaCocoRoco@Tzxhy@benz0li

        Issue actions

          [Bug]: Memory leak? · Issue #5201 · coder/code-server