Closed jfuica closed 1 year ago
Hello @jfuica !
The memory consumption is expected - we're indexing the Ada runtime (for instance the sources for Ada.Text_IO), to support cross-references for the full closure of the program. This explains the around 0.7 gb of memory consumption, and is expected.
However it should be much faster than this - measured in seconds rather than minutes. Unless you are investigating memory consumption, you should deactivate the trace DEBUG.ADA_MEMORY
, which introduces a very significant performance overhead.
Best regards,
Nicolas
You can also control the runtime indexing via the trace ALS.RUNTIME_INDEXING
. Turning this off means less memory footprint, but operations such as "Find all references" on runtime entities won't return complete results within the body of the runtime.
The memory consumption is expected - we're indexing the Ada runtime (for instance the sources for Ada.Text_IO), to support cross-references for the full closure of the program. This explains the around 0.7 gb of memory consumption, and is expected.
Also, to complete @setton 's answer, the GNAT ada runtime is at least ~350000 lines, so you should expect this to scale quite well on big projects, since this seems to be one of your worries.
Hello, Nicolas, Raphël,
"ada.enableIndexing": false => The vscode does not recognise this config variable, but it works.
+
ALS.RUNTIME_INDEXING=no
It does the trick!, now, my RAM usage is very low, and the time it takes to start the ada_language_server plugin is fine (at least for small projects).
--
However, if I test this configuration in a big project, the amount of RAM used is around 2-3GB. Therefore, my concern is : if the amount needed for every instance of the ada_language is 3 GB * let say 5 programmers = 15GB would be needed in the server only for programming.
I am still investigating why is this RAM usage so high, and If I can reduce it removing some directories from the *.gpr.
Thanks for your quick response, it was really helpful!
However, if I test this configuration in a big project, the amount of RAM used is around 2-3GB. Therefore, my concern is : if the amount needed for every instance of the ada_language is 3 GB * let say 5 programmers = 15GB would be needed in the server only for programming.
That's indeed a concern, but unfortunately one that we don't know how to solve yet. Ideally we would be able to share a libadalang instance amongst all servers for a same project, but we don't have the technology to do that - at least not in the foreseeable future :)
Short term, the ALS has been conceived more as something that is supposed to run on your personal dev machine, where memory usage should be reasonable given current machine specs and size of projects.
Hello,
I have been playing around with this promising Ada plugin for vscode (congratulations!), and apart from some "bugs" (they will be fixed for sure in future versions), i found that the plugin itself is using too much RAM (resident) in a linux machine :
Using a simple default.gpr and a test.adb :
p_test.adb
Then, after executing the vscode locally in the linux machine (also happens if the vscode is launched remotely, and connected throught ssh), I realise that the resident mem usage is really high (in my opinion, for a simple programme) :
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15296 nor 20 0 448960 13372 8688 S 0.0 0.2 0:00.38 /home/nor/.vscode/extensions/adacore.ada-23.0.10/linux/ada_languag+ 15297 nor 20 0 1073864 690764 21880 S 0.0 8.5 4:15.20 /home/nor/.vscode/extensions/adacore.ada-23.0.10/linux/ada_languag+
Therefore 0.7GB is too much, in my opinion. I can not figure out how much could be needed for large projects
--
This is what I have found:
1.- The vscode is indexing around 1500 files ( coming from the compiler sources?)
The "indexing process" takes around 4-5 minutes to be finished, using a 100% of CPU.
Note : I tried to remove this functionality setting the "ada.enableIndexing to false", but in the last version, I can not figure out how to do it.
2.- Als traces :
als.xxx
Only final lines, inout.txt
Best Regards.