For some reason my swiftlint processes leak memory.

N/A, I'm using SwiftLint via the VSCode extension.
swiftlint version to be sure)?disabled_rules:
- trailing_comma
- identifier_name
- void_return
- operator_whitespace
- nesting
- cyclomatic_complexity
line_length:
- 100
- 140
function_body_length:
- 50
excluded: # paths to ignore during linting. Takes precedence over `included`.
- .build
- Example/Pods
- Tests/CoreXLSXTests/XCTestManifests.swift
xcodebuild -version)?Are you saying that once SwiftLint terminates it's still retaining memory? Or that the process of linting takes more memory than you'd expect? SwiftLint caches the contents of every file it's linting, and some indexes around them, that definitely contributes to significant memory usage.
It doesn't look like it terminates at all, I'll check CPU time next time I see this. But even with caching tens of gigabytes of memory consumed don't seem to be normal. I'm using that VSCode extension for quite a long time, and this started happening only recently, maybe after I upgraded to 0.41.0. I run brew upgrade regularly, but I don't remember when exactly I upgraded.
The fact that SwiftLint isn't terminating is more concerning. Can you reproduce this running it from the command line?
I ran swiftlint in CLI on the same project that caused this issue in VSCode, and it terminated normally (in a fraction of a second).
Got it now with CPU time, here you can see two processes running for minutes now. It's reproducible with CoreXLSX for me when I open and edit it in VSCode. I have it set up so that it runs SwiftLint every time I save a file in it.

Also, these processes don't die after I close VSCode, and their CPU load sticks to about 10-20% on average. Maybe they're stuck in some kind of a loop when interacting with SourceKit, or something like that?
Given that this doesn't happen from the command line, but rather from the VSCode extension, can you please open an issue there? I'm not familiar with it and I don't know how they integrate with SwiftLint.
I can open it there, but I hope it also stays open here. Regardless of what the VSCode extension is doing, I feel that it's a bug that SwiftLint can be stuck in such state, if that makes sense?
It might be a SwiftLint bug, it depends if the VSCode extension is using SwiftLint in an unsupported way.
Hi. Presumably there has been a bug in the latest version of my extension. As a temporary hot fix I shipped an old version.
My guess: the extension runs SwiftLint from the wrong directory (maybe even root instead of the current folder!).
If it's true, SwiftLint handles it very well. Will report back once I know for sure the next days.
Sorry for the inconvenience.
I just had a look on the bug:
=> SwiftLint does exactly what it has been told to do. No bug in this repo.
Awesome, thanks! This can be closed then.
Thanks for investigating!
Most helpful comment
It might be a SwiftLint bug, it depends if the VSCode extension is using SwiftLint in an unsupported way.