It was reported by some of my colleagues, and after that I noticed it myself, that on a large project during the startup Expert uses large amount of memory in peaks. Talking about memory usage reported by MacOS's Activity Monitor (so not just RAM) we are talking about up to 10GB on the manager node and 2.5GB on Engine node. After doing the whole startup the memory usage goes down to about 1.5GB on manager and similar on Engine.
My investigation traced it to the fact that we index the code in Engine and then we send the whole large list to Manager, which then sends it through couple of GenServers until it's batched and saved to SQLite.
I did a prototype with Codex, batching the index results with backpressure and calling garbage collection in few places aggressively. With that the manager node stayed under 600MB quite consistently. This leads me to believe that this is a direction worth pursuing. The prototype itself was a large change and not without issues on it's own, so I'm first creating this tracking issue, because it will probably be better to split the improvements into few more focused PR. Also I wonder what others think.
It was reported by some of my colleagues, and after that I noticed it myself, that on a large project during the startup Expert uses large amount of memory in peaks. Talking about memory usage reported by MacOS's Activity Monitor (so not just RAM) we are talking about up to 10GB on the manager node and 2.5GB on Engine node. After doing the whole startup the memory usage goes down to about 1.5GB on manager and similar on Engine.
My investigation traced it to the fact that we index the code in Engine and then we send the whole large list to Manager, which then sends it through couple of GenServers until it's batched and saved to SQLite.
I did a prototype with Codex, batching the index results with backpressure and calling garbage collection in few places aggressively. With that the manager node stayed under 600MB quite consistently. This leads me to believe that this is a direction worth pursuing. The prototype itself was a large change and not without issues on it's own, so I'm first creating this tracking issue, because it will probably be better to split the improvements into few more focused PR. Also I wonder what others think.