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-1532] Memory leak in CharacterView.dropFirst? #44141

Open
Bouke opened this issue May 16, 2016 · 0 comments
Open

[SR-1532] Memory leak in CharacterView.dropFirst? #44141

Bouke opened this issue May 16, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak standard library Area: Standard library umbrella

Comments

@Bouke
Copy link
Contributor

Bouke commented May 16, 2016

Previous ID SR-1532
Radar rdar://problem/26499810
Original Reporter @Bouke
Type Bug
Environment

Snapshot of 9th of may on OSX.
Welcome to Apple Swift version 3.0-dev (LLVM dffa09ffd8, Clang 9f0d189820, Swift 1c720b8).

Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug, Leak
Assignee None
Priority Medium

md5: e40f8b3d3bf6d3b4eccec3ff2e3402b8

Issue Description:

Feed the following program a file of a few bytes; and watch memory consumption steadily grow. It consumes a few GB within minutes. As the result of input.dropFirst() is unused, I would assume that it should be freed directly?

import Foundation
var i = 0
var input = (try! String(contentsOfFile: Process.arguments[1])).characters
while true {
    input.dropFirst()
    i += 1
    if(i % 100000 == 0) { print("Dropped \(i) characters") }
}
@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 memory leak bug: Memory leak standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant