Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11352] typeCheckStmt: High Memory Usage while Indexing in Xcode #53753

Open
troughton opened this issue Aug 22, 2019 · 6 comments
Open

[SR-11352] typeCheckStmt: High Memory Usage while Indexing in Xcode #53753

troughton opened this issue Aug 22, 2019 · 6 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@troughton
Copy link
Contributor

Previous ID SR-11352
Radar rdar://problem/54601069
Original Reporter @troughton
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler, Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: d2a366dcc556b4f530f2e542e9832253

Issue Description:

While viewing the attached project (SwiftFrameGraph.zip) within Xcode 11 beta 6 (default toolchain), the project gets stuck during indexing. While this is happening, memory usage climbs very quickly, exhausting the system memory/swap space in under a minute.

I was looking at the file `SpinLock.swift` when I noticed this, but it seems to be independent of the current source file.

The project is a SwiftPM project, so `swift package clean` and `swift package generate-xcodeproj` might be needed.

I've also attached an Instruments trace of swift taken while this problem was occurring.

@belkadan
Copy link
Contributor

This is happening in the expression type checker, so possibly related to what @DougGregor and @xedin have been looking at?

@belkadan
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented Aug 23, 2019

Looks like this is one of the exponential cases, which is an open problem still.

@troughton
Copy link
Contributor Author

Is this something that the typechecking time/attempt limits should be catching, or does that not apply when being run via the Xcode indexer?

@xedin
Copy link
Member

xedin commented Aug 26, 2019

@nathawes Do you know whether the flags are propagated?

@nathawes
Copy link
Collaborator

I would think it would, but we get whatever Xcode's build system sends us. You can check by enabling the index log (run `
defaults write com.apple.dt.Xcode IDEIndexShowLog 1` in Terminal) and seeing if the flags come through in the Project > Index entries in Xcode's report navigator pane.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

4 participants