title: Memory leak UIImage in Swift 4 ImageIO_jpeg_Data
body: <p>I have two UIViewController in which the photos are displayed, the fact is that when I switch between them, then I add 50-70mb of RAM and so on ad infinitum.</p>
  
  <p><img src="https://i.stack.imgur.com/jsjjb.png" alt="image 1"></p>
  
  <p><img src="https://i.stack.imgur.com/r18pn.png" alt="image 2"></p>
  
  <p>'</p>
  
  <pre><code>var tags: [TagForRecipe] = [] // CoreData entity
  
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: "tagCell", for: indexPath) as! TagsTableViewCell
  
      cell.tags.text = tags[indexPath.row].nameTag
      cell.images.image = UIImage(contentsOfFile: (tags[indexPath.row].image as! URL).path)
  
      return cell
  }
  
  
  
  import UIKit
  
  class TagsTableViewCell: UITableViewCell {
  
  
      @IBOutlet weak var images: UIImageView!
  
      @IBOutlet weak var tags: UILabel!
  
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
      }
  
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
  
          // Configure the view for the selected state
      }
  
  }
  </code></pre>
  
  <p>'</p>