I'm creating a ViewController object an pushing it to a navigation controller. When the object is being popped from the stack - it is not being release and Deinit is not being called. What can be the reason for that?

Here's the code that pushes:

self.navigationController?.pushViewController(CustomViewController(), animated: true)

And here's the code that pops:

 self.navigationController?.popViewControllerAnimated(true)

I had similar problem. I added empty deinit method to my class and added breakpoint:

deinit {

}

As result it's never called.
As soon as I add some code to the body it started working as expected:

deinit {
    print("deinit called")
}

So be sure that your deinit method isn't empty.
PS. I am using Swift 2, Xcode 7.1


Do any of your classes, or properties they contain make a reference to the view controller you've popped?

If your UIViewController has created an instance of an object, which in turn makes a 'strong' reference to that view controller (e.g. a reference that's not explicitly declared 'weak' or 'unowned'), and your view controller keeps a strong reference to that object as well, neither will be deallocated. That's called a strong reference cycle, documented here (a must read for serious Swift developers):

The Swift Programming Language (Swift 3.0.1): Automatic Reference Counting

Closures are a more insidious case where you can get into trouble.

One thing you might try as an experiment is pushing the controller and popping it before you do anything in viewDidLoad or in the initialization, and see if the deinit method is being called. If it is, then you should be able to incrementally discover what you're doing that's leading to the symptom you're seeing.

Another thing that can thwart diagnosis (as other answers have pointed out), which I learned the hard way, is that the debugger breakpoint won't be taken for deinit() if the deinit method contains no executable statements, because the OS or compiler optimizes the deinit invocation away if it's empty, so at least put a print statement there if you want to verify deinit() is getting called.