code-server: [Bug]: Memory leak?
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
- Install code-server and run its daemon
- Continually measure memory usage of the process
- 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
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 19 (5 by maintainers)
My โsolutionโ was adding a line to crontab to restart code-server every 24 hours ๐
Volar Extension used about 700MB per instance in my case. It also felt like it did still run in the background after closing an workspace.
Oh, sorry. I just found that the memory usage inside docker container and outside is not same, and the difference can be large. In container, use
free -hgetused + cachedcan be 7GB, but outside container, usedocker stats containerID, show1GB / 7GB.@jsjoeio Thanks, i will look into it!
Not that Iโm aware of. Found some things Iโd read to look into it though:
https://www.npmjs.com/package/heapdump?
No. I have VSCode continually open on a MacBook for weeks and never had a memory issue. Same for a ChromeOS device.