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-15175] withTaskGroup(of:) leaks huge amounts of memory on linux #57498

Closed
kelvin13 opened this issue Sep 9, 2021 · 3 comments
Closed

[SR-15175] withTaskGroup(of:) leaks huge amounts of memory on linux #57498

kelvin13 opened this issue Sep 9, 2021 · 3 comments

Comments

@kelvin13
Copy link
Contributor

@kelvin13 kelvin13 commented Sep 9, 2021

Previous ID SR-15175
Radar rdar://problem/82915223
Original Reporter @kelvin13
Type Bug
Status Resolved
Resolution Done
Environment

$ swiftc --version
Swift version 5.6-dev (LLVM ca88d53176e346a, Swift a382f58)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Concurrency
Assignee @ktoso
Priority Medium

md5: f1817e9d7d79ccaf4ae2040ad5ed80ce

relates to:

  • SR-14973 withTaskGroup leaks memory for every task added to the group

Issue Description:

on my machine, the following test program leaks over 3.5 GB of memory per second:

// taskgroup.swift 

@main 
enum Main 
{
    static 
    func main() async
    {
        while true 
        {
            await withTaskGroup(of: Void.self) 
            { 
                _ in
            } 
        }
    }
}

$ swiftenv local DEVELOPMENT-SNAPSHOT-2021-09-07-a
$ swiftc -parse-as-library -O taskgroup.swift 
$ ./taskgroup

this issue only occurs with linux builds. macos builds do not leak memory as far as i have observed.

please note: unlike SR-14973, this memory leak occurs even when no tasks are added to the task group.

@ktoso
Copy link
Member

@ktoso ktoso commented Sep 9, 2021

@swift-ci create

@ktoso
Copy link
Member

@ktoso ktoso commented Sep 9, 2021

Thanks, it’s definitely unexpected… will dig into it.

@ktoso
Copy link
Member

@ktoso ktoso commented Sep 14, 2021

Thanks a lot for reporting!

Fixed by #39295

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants