Usually, my app uses around 50MB of RAM at the most, but I recently noticed that RAM usage was over 100MB.
This happens on a UITableViewController
. I have a prototype cell with an UIImageView
, and beside it, a UIStackView
which contains two labels, and another UIStackView
containing a UIImageView
and UILabel
.
After investigating, I found that it was the UITableViewCell
, and more specifically when I have a UIStackView
within it. When I load more cells, the memory goes up even higher. I'm not even doing any modification to the cell in cellForRowAt:
, and I've tested this with a separate cell just to make sure, and I had the same issue.
Instruments shows that there are no memory leaks.
I'm using Xcode 9 Beta 5 and Swift 4.
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "MyCell", for: indexPath)
return cell
}