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-4889] Memory leak when using simple [String: Int] dictionary #47466

Closed
swift-ci opened this issue May 15, 2017 · 5 comments
Closed

[SR-4889] Memory leak when using simple [String: Int] dictionary #47466

swift-ci opened this issue May 15, 2017 · 5 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. memory leak bug: Memory leak standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-4889
Radar rdar://problem/32199117
Original Reporter scelis (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Target: x86_64-apple-macosx10.9
macOS 10.12.4 (16E195)

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

md5: 1760583001e280ddf5a4b55fa63eeedb

Issue Description:

Attached is some Swift code I was using to solve http://adventofcode.com/2016/day/23

It simulates a computer with a simple instruction set and four registers. When storing these registers into a `[String: Int]` dictionary, the program's memory footprint quickly balloons to an incredible size (multiple GBs within a minute). If the registers are instead stored in an `[Int]` array, the program executes for a long time with no perceivable memory issues.

Given the attached code I would expect both solutions to use a similar (trivial) about of memory.

I was able to replicate this issue both inside of Xcode as well as on the command line.

@belkadan
Copy link
Contributor

Oops, sorry, wrong bug.

@belkadan
Copy link
Contributor

leaks reports no actual leaks, which makes me suspect there's a giant autorelease pool somewhere here.

@belkadan
Copy link
Contributor

…but I don't see any obvious places that would introduce that.

@belkadan
Copy link
Contributor

@swift-ci create

@belkadan
Copy link
Contributor

Fixed by aschwaighofer@apple.com (JIRA User) in #12312 (master) and #12343 (4.0 branch).

@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
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. memory leak bug: Memory leak standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants