Commit 66f84f6
committed
Fix memory leak in DirectoryScanner
- Remove codeBlocks accumulation that was causing memory exhaustion
- Fix batch processing bugs where file info was added multiple times per file
- Move totalBlockCount increment outside block loop to fix counting bug
- Return empty codeBlocks array since it's not used by main orchestrator logic
- Update tests to expect empty codeBlocks array
This fixes the extension running out of memory during indexing of large codebases.
The memory usage should drop from ~500MB-1GB to ~10-50MB for large projects.1 parent 8c8888a commit 66f84f6
File tree
2 files changed
+35
-25
lines changed- src/services/code-index/processors
- __tests__
2 files changed
+35
-25
lines changedLines changed: 24 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
| |||
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
188 | | - | |
189 | | - | |
| 197 | + | |
| 198 | + | |
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
| |||
252 | 261 | | |
253 | 262 | | |
254 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
255 | 273 | | |
256 | 274 | | |
257 | 275 | | |
| |||
306 | 324 | | |
307 | 325 | | |
308 | 326 | | |
309 | | - | |
| 327 | + | |
310 | 328 | | |
311 | 329 | | |
312 | 330 | | |
313 | 331 | | |
314 | 332 | | |
315 | 333 | | |
316 | 334 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
| 335 | + | |
| 336 | + | |
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | | - | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
149 | | - | |
150 | 147 | | |
151 | 148 | | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | 152 | | |
164 | 153 | | |
165 | 154 | | |
| |||
188 | 177 | | |
189 | 178 | | |
190 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
| |||
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
283 | | - | |
| 282 | + | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
| |||
0 commit comments