How to minimize memory usage when using viewController without the navigation stack or segues
<p>I am working on a massive App a lot going on in the background by myself. I created a custom UI that in a general sense functions like Zillow. It has one main view controller that is empty, but handles transitions between all the vieww controllers in the App besides a few small ones that are segues of view controllers at least a couple of layers deep. I ensured that all the deinits of all the controller was always called the moment I was done with them a while back. It has a leftViewController, a rightViewController, a map in the middle, and mini maps on the right side when the left and right viewcontrollers are nil. I instantiate the controllers using </p>

<pre><code>//step 1
class func mainStoryboard() -&gt; UIStoryboard {
        return UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
    }
    class func viewController() -&gt; UINavigationController? {
        return mainStoryboard().instantiateViewControllerWithIdentifier("viewController") as? UINavigationController
    }
}

//step2
viewController = {
    let nav = UIStoryboard.viewController()!
    let child = nav.childViewControllers.first! as! ViewController
    //do work normal done in prepareForSegue
    return nav
}()
whichSideWillPanelSpawn = .right //(or .left)
addChildSidePanelController(viewController)

//step3
private func addChildSidePanelController(controller: UIViewController, whichSideWillPanelSpawn: WhichSideWillPanelSpawnEnum) {
    controller.view.frame = CGRectMake(0, 0, totalWidth - rectWidth, view.bounds.height)
    switch orientation {
    case .left:
        controller.view.frame.origin.x = 0
        view.insertSubview(controller.view, atIndex: 0)
    case .right:
        controller.view.frame.origin.x = totalWidth
        view.insertSubview(controller.view, aboveSubview: someController)
    }
    addChildViewController(controller)

    controller.didMoveToParentViewController(self)
    UIView.animateWithDuration(0.8, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: .CurveEaseInOut, animations: {
        controller!.view.frame.origin.x = someValueForPostitioning
    }, completion: completion)
}
</code></pre>

<p>I tried to get basically what i am doing in there, but I removed a bulk of the code. I have no problem with the functionality, so no worries if something looks like it shouldn't work. My question is that when instantiating views in this regard instead of using the navigation stack, are there specific things I can look for in memory leaks? </p>

<p>Example 1: 
When I open up specific view controllers, I lose memory and never get it back. I halved the memory usage in my work so far by trying to add [unowned self] or [weak self] in all my closures. I am about to start working on making sure I am not needlessly casting variables like Int(thisInt) over (thisInt as Int). Still, I lose this memory even after the view controller I made deinits. Where did the memory go if there is no longer a pointer to the view controller? It does not increase in amount when I return to it from before, but the increase does not get reduced except by the smallest amount after the deinit. I have a theory that this part has something to do with Core Data as the scope of my core data variables increases even though the amount should be minimal I would think, maybe a lot more of the contents are brought into memory than I realize. Although if this were the case, I would think that the values of increase would vary more as the size of what I store in data multiplies in size (I store location objects with tons of data being stored depending on each locations information they fill out about them.), but the size seems fairly constant in growth based on my actions.</p>

<p>Example 2:
If I spam click a spot on the screen that will bring me back and forth between the base view with no right or left view controller and the first left view controller to spawn, I can watch the memory usage grow even though I see the view controller deinit every time I go back and forth. Spam clicking like this will cause it to never peak while if I click slowly it will peak. I only have one pointer to left view controller that handles all the view controllers that can spawn on the left side. Then I have one on the right that handles all of them on the right. Why would the memory continue to grow when I spam click and not when I click back and forth normally? I have safety things in place to prevent the any transition from starting until the prior transition finished. </p>

<p>I have read several articles on memory usage and am boggling my head over where I am at now. Should I find a way to use the navigation stack over my 2 viewcontroller pointers? Why does spam clicking make memory stay gone for the remainder of my usage? What other methods can I use to spot my leaks that I have not mentioned? What is an acceptable amount of memory usage to take place nonstop for an iPad App? After a viewController deinits what remnants are left behind to clean up to reduce memory usage more? I know I am asking a lot, but I am getting closer to release every day, and this has become a temporary thing to delve into. I've been taking building an enterprise App by myself one step at a time. Thanks for your time and responses in advance!!!</p>