Open ebak opened 3 days ago
Synced to Apple’s issue tracker as rdar://130844901
Hey @ebak,
A couple of questions:
Hi,
Now I don't have possibility to try it on the machine with 8 CPUs, maybe next week.
How much memory does sourcekit-lsp use on your machine? I would be expecting something <500MB on start up, fairly independent of your CPU core count.
I attach screenshots of htop
output, as I see at startup it only consumes 2.8% (I don't know what htop
means about this percentage.)
Does the memory usage of SourceKit-LSP grow over time or does it go up immediately after launching
Grows over time. As I see build and source browsing is required for it.
Does this also reproduce with a Swift 6 toolchain. We have made significant changes to SourceKit-LSP between 5.10 and 6.0, so the issue might already be fixed.
Not yet tried out, maybe I'll do when I have possibility to play it around with the system with 8 CPUs.
Does the memory usage go up on every project that you open or only on specific ones? If so, would you be able to share the project?
Recently I was working with this project (QtTest
):
QtTest.zip
Just by editing the same code, the memory usage quickly goes up to 45% (3.6GB maybe):
Maybe unrelated but VSCode
usually forgets about the dependent packages:
The dependencies (Qlift
, Math
) are sometimes shown up there, sometimes not.
Sad the 8GB RAM is hardly enough for IDE assisted development. In my case the opened apps almost use up all free memory (Gnome, 2 terminals, 2 file managers, a light weight editor (gedit), an ebook reader for the Swift book, VSCode with Swift instrumentation). Opening up a Firefox with 1-2 tabs would easily freeze out the system.
Description
I have recently tried out the stable tool-chain (installed with
swiftly
onManjaro Linux
) withVSCode
and itsSwift plugin
. The memory usage ofsourcekit-lsp
easily freezes out the machine.The machine has 16 CPU threads (8 core with 2 HW threads), but only 8GB RAM. As I suspect the number of
sourcekit-lsp
threads scales up based on the number of CPU threads.Is it possible to explicitly limit the
sourcekit-lsp
threads? (Linux allows to turn off some cores, but that is not too convenient.)Or would it be possible to also consider available RAM too when spawning
sourcekit-lsp
threads? E.g. for 8GB of RAM only spawn 3 threads, even if the machine have 256 CPUs.