[SR-4889] Memory leak when using simple [String: Int] dictionary #47466
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
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
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.
The text was updated successfully, but these errors were encountered: