CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

The CopilotForXcode used 508GB of memory

Open akuzminskyi opened this issue 5 months ago • 8 comments
trafficstars

Describe the bug The CopilotForXcode used 508GB of memory, I suppose this is too much.

Versions

  • Copilot for Xcode: 0.35.0
  • Xcode: 16.3
  • macOS: 15.5

Screenshots Image

Logs github-copilot-for-xcode.log.zip

Additional context

akuzminskyi avatar May 22 '25 10:05 akuzminskyi

Seeing simliar behavior. Was wondering why my machine suddenly wanted to take a trip to the moon.

zenangst avatar May 22 '25 10:05 zenangst

The indexing job may consume significant system resources while indexing your workspace. Could you share the approximate size of your codebase so we can better estimate the impact? thanks.

testforstephen avatar May 22 '25 12:05 testforstephen

$ tokei .
===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 C Header              182        25854         6748        15385         3721
 JavaScript              1           31           27            0            4
 JSON                  628        91694        91694            0            0
 Python                  1          197          157            6           34
 Shell                  18          728          541           69          118
 SVG                     2            2            2            0            0
 Swift                2372       225716       189211         5741        30764
 TypeScript              1           45           45            0            0
 Xcode Config           63          616          504            2          110
 YAML                    2           12           12            0            0
-------------------------------------------------------------------------------
 Markdown                1          101            0           65           36
 |- BASH                 1           13           13            0            0
 (Total)                            114           13           65           36
===============================================================================
 Total                3271       344996       288941        21268        34787
===============================================================================

zenangst avatar May 22 '25 13:05 zenangst

--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
JSON                          26706           3617              0        3928782
Swift                         14151         246462         154919        1345937
YAML                            551           2452            247         405809
HTML                            274           5981             14         145816
XML                             964            518            211         103509
C/C++ Header                    384          16054          69107          81802
Objective-C                     262           7224           4693          39075
Markdown                        398          13553            114          34850

akuzminskyi avatar May 23 '25 07:05 akuzminskyi

@zenangst @akuzminskyi thank you for sharing the info. they're helpful for us to setup benchmark. we will investigate further to see how to mitigate it.

testforstephen avatar May 23 '25 07:05 testforstephen

I also work on a huge project and I'm getting constant v8::internal::V8::FatalProcessOutOfMemory lately. Makes copilot basically unusable. I don't get past 8GB of allocated memory though, not sure how you guys can go above that.

albianto avatar May 23 '25 08:05 albianto

Hi @akuzminskyi, in your case, the real memory usage is 201M, not 508G.

508G memory in your screenshot is the virtual memory space that’s given to copilot. It has no relation with the actual physical memory and storage usage. I took a look into all nodejs processes running in my MacBook Pro, all of them show 390G+ virtual memory size. I think virtual memory size is not a meaningful metric for evaluating memory consumption.

testforstephen avatar May 24 '25 08:05 testforstephen

@testforstephen thanks. feel free to close the issue if this is irrelevant

akuzminskyi avatar May 24 '25 19:05 akuzminskyi

Can we disable the indexing process?

It makes the Copilot basically unusable on my $workCodebase, in addition to making the Xcode itself even laggier than usual — to the point I have to kill the Copilot processes to be able to type normally.

jklausa avatar Sep 05 '25 08:09 jklausa