Periphery crashing due to High memory usage
Describe the bug A clear and concise description of what the bug is. Running this command takes about 2 hours to complete and results in it being killed by the system due to high memory usage: This died when process memory usage was 174GB and system swap was up to 62GB.
periphery scan --project Foo.xcodeproj --schemes FooPeriphery --skip-build --index-store-path $INDEX_ROOT --format xcode --exclude-tests --exclude-targets DesignComponentsDebugPanel
I noticed that near the end we entered a zone of use that was spiking memory alerts:
Stack Trace sample: Sample of periphery.txt
Reproduction If you are reporting an incorrect result, please provide a sample Xcode or Swift package project that reproduces the issue.
- Not sure how to repro this w/o recreating the entire complexity of the workspace structure.
- Unable to determine if this was caused by long target dependency loops in our targets.
Environment Copy the output from running:
3.2.0
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5) Target: arm64-apple-macosx15.0
Xcode 16.4 Build version 16F6
.periphery.yml
project: foo.xcodeproj
retain_objc_accessible: true
retain_public: true
schemes:
- Foo
- FooPlatform
- FooUI
- GlassUI
+1 bump for any info. cc: @ileitch Thanks in advance.
Are these projects very large? How many source files are being indexed?
This appears to be fixed for us. There was a fix posted on your side that addressed the circular ref in the AST.
In fact, even with a project with about 30K files with ~45K classes/structs, it only took about 2-3 minutes to generate the report. The dump of the 60k issues took a lot more time.
That's great to hear! I assume it was resolved by https://github.com/peripheryapp/periphery/commit/f97204e7c84d17733cc511f17057ea601c3ea099.